RTEMS  5.1
Files | Data Structures | Typedefs | Functions | Variables
File System Operations

File system operations. More...

Files

file  default_are_nodes_equal.c
 RTEMS Default File System has nodes equal.
 
file  default_clone.c
 RTEMS Default File System creates a child process.
 
file  default_eval_path.c
 RTEMS Default File System evaluates relative pathname to absolute.
 
file  default_fstat.c
 RTEMS Default File System gets file status.
 
file  default_fsync.c
 RTEMS Default File System Synchronises changes to a file.
 
file  default_fsync_success.c
 RTEMS Default Filesystem succeeds synchronizing file's in-core state.
 
file  default_ftruncate.c
 RTEMS Default File System Truncates a file to indicated length.
 
file  default_ioctl.c
 RTEMS Default File System controls a STREAMS device.
 
file  default_lock_and_unlock.c
 RTEMS Default File System locks and unlocks rtems filesystem.
 
file  default_lseek.c
 RTEMS Default File System reposits the read/write file offset.
 
file  default_lseek_directory.c
 RTEMS Default File System reposits read/write file offset directory.
 
file  default_lseek_file.c
 RTEMS Default File System reposits the offset of the open file fd.
 
file  default_mknod.c
 RTEMS Default File System creates a special or ordinary file.
 
file  default_mount.c
 RTEMS Default File System mounts a filesystem.
 
file  default_rename.c
 RTEMS Default File System Rename Files.
 
 
file  default_unmount.c
 RTEMS Default File System Unmounts.
 
file  default_utime.c
 RTEMS Default File System sets file access and modification times.
 
file  default_write.c
 RTEMS Default File System sends a message to another user.
 

Data Structures

struct  rtems_filesystem_eval_path_context_t
 Path evaluation context. More...
 
struct  _rtems_filesystem_operations_table
 File system operations table. More...
 

Typedefs

typedef void(* rtems_filesystem_mt_entry_lock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry)
 Locks a file system instance. More...
 
typedef void(* rtems_filesystem_mt_entry_unlock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry)
 Unlocks a file system instance. More...
 
typedef void(* rtems_filesystem_eval_path_t) (rtems_filesystem_eval_path_context_t *ctx)
 Path evaluation. More...
 
typedef int(* rtems_filesystem_link_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
 Creates a new link for the existing file. More...
 
typedef int(* rtems_filesystem_fchmod_t) (const rtems_filesystem_location_info_t *loc, mode_t mode)
 Changes the mode of a node. More...
 
typedef int(* rtems_filesystem_chown_t) (const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
 Changes owner and group of a node. More...
 
typedef int(* rtems_filesystem_clonenode_t) (rtems_filesystem_location_info_t *loc)
 Clones a location. More...
 
typedef void(* rtems_filesystem_freenode_t) (const rtems_filesystem_location_info_t *loc)
 Frees the location of a node. More...
 
typedef int(* rtems_filesystem_mount_t) (rtems_filesystem_mount_table_entry_t *mt_entry)
 Mounts a file system instance in a mount point (directory). More...
 
typedef int(* rtems_filesystem_fsmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
 Initializes a file system instance. More...
 
typedef int(* rtems_filesystem_unmount_t) (rtems_filesystem_mount_table_entry_t *mt_entry)
 Unmounts a file system instance in a mount point (directory). More...
 
typedef void(* rtems_filesystem_fsunmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry)
 Destroys a file system instance. More...
 
typedef bool(* rtems_filesystem_are_nodes_equal_t) (const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
 Tests if the node of one location is equal to the node of the other location. More...
 
typedef int(* rtems_filesystem_mknod_t) (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
 Creates a new node. More...
 
typedef int(* rtems_filesystem_rmnod_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
 Removes a node. More...
 
typedef int(* rtems_filesystem_utime_t) (const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
 Set node access and modification times. More...
 
typedef int(* rtems_filesystem_symlink_t) (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
 Makes a symbolic link to a node. More...
 
typedef ssize_t(* rtems_filesystem_readlink_t) (const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
 Reads the contents of a symbolic link. More...
 
typedef int(* rtems_filesystem_rename_t) (const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
 Renames a node. More...
 
typedef int(* rtems_filesystem_statvfs_t) (const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
 Gets file system information. More...
 

Functions

void rtems_filesystem_default_lock (const rtems_filesystem_mount_table_entry_t *mt_entry)
 Obtains the IO library mutex. More...
 
void rtems_filesystem_default_unlock (const rtems_filesystem_mount_table_entry_t *mt_entry)
 Releases the IO library mutex. More...
 
void rtems_filesystem_default_eval_path (rtems_filesystem_eval_path_context_t *ctx)
 Terminates the path evaluation and replaces the current location with the null location. More...
 
int rtems_filesystem_default_link (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
 
bool rtems_filesystem_default_are_nodes_equal (const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
 Tests if the node access pointer of one location is equal to the node access pointer of the other location. More...
 
int rtems_filesystem_default_mknod (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
 
int rtems_filesystem_default_rmnod (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
 
int rtems_filesystem_default_fchmod (const rtems_filesystem_location_info_t *loc, mode_t mode)
 
int rtems_filesystem_default_chown (const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
 
int rtems_filesystem_default_clonenode (rtems_filesystem_location_info_t *loc)
 
void rtems_filesystem_default_freenode (const rtems_filesystem_location_info_t *loc)
 
int rtems_filesystem_default_mount (rtems_filesystem_mount_table_entry_t *mt_entry)
 
int rtems_filesystem_default_unmount (rtems_filesystem_mount_table_entry_t *mt_entry)
 
void rtems_filesystem_default_fsunmount (rtems_filesystem_mount_table_entry_t *mt_entry)
 
int rtems_filesystem_default_utime (const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
 
int rtems_filesystem_default_symlink (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
 
ssize_t rtems_filesystem_default_readlink (const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
 
int rtems_filesystem_default_rename (const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
 
int rtems_filesystem_default_statvfs (const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
 

Variables

const rtems_filesystem_operations_table rtems_filesystem_operations_default
 File system operations table with default operations.
 

Detailed Description

File system operations.

Typedef Documentation

◆ rtems_filesystem_are_nodes_equal_t

typedef bool(* rtems_filesystem_are_nodes_equal_t) (const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)

Tests if the node of one location is equal to the node of the other location.

The caller ensures that both nodes are within the same file system instance.

Parameters
[in]aThe one location.
[in]bThe other location.
Return values
trueThe nodes of the locations are equal.
falseOtherwise.
See also
rtems_filesystem_default_are_nodes_equal().

◆ rtems_filesystem_chown_t

typedef int(* rtems_filesystem_chown_t) (const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)

Changes owner and group of a node.

Parameters
[in]locThe location of the node.
[in]ownerUser ID for the node.
[in]groupGroup ID for the node.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_chown().

◆ rtems_filesystem_clonenode_t

typedef int(* rtems_filesystem_clonenode_t) (rtems_filesystem_location_info_t *loc)

Clones a location.

The location is initialized with a bitwise copy of an existing location. The caller must ensure that this location is protected from a release during the clone operation. After a successful clone operation the clone will be added to the location chain of the corresponding mount table entry.

Parameters
[in,out]locLocation to clone.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_clonenode().

◆ rtems_filesystem_eval_path_t

typedef void(* rtems_filesystem_eval_path_t) (rtems_filesystem_eval_path_context_t *ctx)

Path evaluation.

Parameters
[in,out]ctxThe path evaluation context.
See also
rtems_filesystem_default_eval_path().

◆ rtems_filesystem_fchmod_t

typedef int(* rtems_filesystem_fchmod_t) (const rtems_filesystem_location_info_t *loc, mode_t mode)

Changes the mode of a node.

Parameters
[in]locThe location of the node.
[in]modeThe new mode of the node
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_fchmod().

◆ rtems_filesystem_freenode_t

typedef void(* rtems_filesystem_freenode_t) (const rtems_filesystem_location_info_t *loc)

Frees the location of a node.

Parameters
[in]locThe location of the node.
See also
rtems_filesystem_default_freenode().

◆ rtems_filesystem_fsmount_me_t

typedef int(* rtems_filesystem_fsmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)

Initializes a file system instance.

This function must initialize the file system root node in the mount table entry.

Parameters
[in]mt_entryThe mount table entry.
[in]dataThe data provided by the user.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.

◆ rtems_filesystem_fsunmount_me_t

typedef void(* rtems_filesystem_fsunmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry)

Destroys a file system instance.

The mount point node location of the mount table entry is invalid. This handler must free the file system root location and all remaining resources of the file system instance.

Parameters
[in]mt_entryThe mount table entry.
See also
rtems_filesystem_default_fsunmount().

◆ rtems_filesystem_link_t

typedef int(* rtems_filesystem_link_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)

Creates a new link for the existing file.

Parameters
[in]parentlocThe location of the parent of the new link.
[in]targetlocThe location of the target file.
[in]nameName for the new link.
[in]namelenLength of the name for the new link in characters.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_link().

◆ rtems_filesystem_mknod_t

typedef int(* rtems_filesystem_mknod_t) (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)

Creates a new node.

This handler should create a new node according to the parameters.

Parameters
[in]parentlocThe location of the parent of the new node.
[in]nameName for the new node.
[in]namelenLength of the name for the new node in characters.
[in]modeMode for the new node.
[in]devOptional device identifier for the new node.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_mknod().

◆ rtems_filesystem_mount_t

typedef int(* rtems_filesystem_mount_t) (rtems_filesystem_mount_table_entry_t *mt_entry)

Mounts a file system instance in a mount point (directory).

The mount point belongs to the file system instance of the handler and is specified by a field of the mount table entry. The handler must check that the mount point is capable of mounting a file system instance. This is the last step during the mount process. The file system instance is fully initialized at this point.

Parameters
[in]mt_entryThe mount table entry.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_mount().

◆ rtems_filesystem_mt_entry_lock_t

typedef void(* rtems_filesystem_mt_entry_lock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry)

Locks a file system instance.

This lock must allow nesting.

Parameters
[in,out]mt_entryThe mount table entry of the file system instance.
See also
rtems_filesystem_default_lock().

◆ rtems_filesystem_mt_entry_unlock_t

typedef void(* rtems_filesystem_mt_entry_unlock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry)

Unlocks a file system instance.

Parameters
[in,out]mt_entryThe mount table entry of the file system instance.
See also
rtems_filesystem_default_unlock().

◆ rtems_filesystem_readlink_t

typedef ssize_t(* rtems_filesystem_readlink_t) (const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)

Reads the contents of a symbolic link.

Parameters
[in]locThe location of the symbolic link.
[out]bufThe buffer for the contents.
[in]bufsizeThe size of the buffer in characters.
Return values
non-negativeSize of the actual contents in characters.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_readlink().

◆ rtems_filesystem_rename_t

typedef int(* rtems_filesystem_rename_t) (const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)

Renames a node.

Parameters
[in]oldparentlocThe location of the parent of the old node.
[in]oldlocThe location of the old node.
[in]newparentlocThe location of the parent of the new node.
[in]nameName for the new node.
[in]namelenLength of the name for the new node in characters.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_rename().

◆ rtems_filesystem_rmnod_t

typedef int(* rtems_filesystem_rmnod_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)

Removes a node.

Parameters
[in]parentlocThe location of the parent of the node.
[in]locThe location of the node.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_rmnod().

◆ rtems_filesystem_statvfs_t

typedef int(* rtems_filesystem_statvfs_t) (const rtems_filesystem_location_info_t *loc, struct statvfs *buf)

Gets file system information.

Parameters
[in]locThe location of a node.
[out]bufBuffer for file system information.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_statvfs().

◆ rtems_filesystem_symlink_t

typedef int(* rtems_filesystem_symlink_t) (const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)

Makes a symbolic link to a node.

Parameters
[in]parentlocThe location of the parent of the new symbolic link.
[in]nameName for the new symbolic link.
[in]namelenLength of the name for the new symbolic link in characters.
[in]targetContents for the symbolic link.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_symlink().

◆ rtems_filesystem_unmount_t

typedef int(* rtems_filesystem_unmount_t) (rtems_filesystem_mount_table_entry_t *mt_entry)

Unmounts a file system instance in a mount point (directory).

In case this function is successful the file system instance will be marked as unmounted. The file system instance will be destroyed when the last reference to it vanishes.

Parameters
[in]mt_entryThe mount table entry.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_unmount().

◆ rtems_filesystem_utime_t

typedef int(* rtems_filesystem_utime_t) (const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)

Set node access and modification times.

Parameters
[in]locThe location of the node.
[in]actimeAccess time for the node.
[in]modtimeModification for the node.
Return values
0Successful operation.
-1An error occurred. The errno is set to indicate the error.
See also
rtems_filesystem_default_utime().

Function Documentation

◆ rtems_filesystem_default_are_nodes_equal()

bool rtems_filesystem_default_are_nodes_equal ( const rtems_filesystem_location_info_t a,
const rtems_filesystem_location_info_t b 
)

Tests if the node access pointer of one location is equal to the node access pointer of the other location.

Parameters
[in]aThe one location.
[in]bThe other location.
Return values
trueThe node access pointers of the locations are equal.
falseOtherwise.
See also
rtems_filesystem_are_nodes_equal_t.

◆ rtems_filesystem_default_chown()

int rtems_filesystem_default_chown ( const rtems_filesystem_location_info_t loc,
uid_t  owner,
gid_t  group 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_chown_t.

◆ rtems_filesystem_default_clonenode()

int rtems_filesystem_default_clonenode ( rtems_filesystem_location_info_t loc)
Return values
0Always.
See also
rtems_filesystem_clonenode_t.

◆ rtems_filesystem_default_eval_path()

void rtems_filesystem_default_eval_path ( rtems_filesystem_eval_path_context_t ctx)

Terminates the path evaluation and replaces the current location with the null location.

See also
rtems_filesystem_eval_path_t.

◆ rtems_filesystem_default_fchmod()

int rtems_filesystem_default_fchmod ( const rtems_filesystem_location_info_t loc,
mode_t  mode 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_fchmod_t.

◆ rtems_filesystem_default_freenode()

void rtems_filesystem_default_freenode ( const rtems_filesystem_location_info_t loc)

◆ rtems_filesystem_default_fsunmount()

void rtems_filesystem_default_fsunmount ( rtems_filesystem_mount_table_entry_t mt_entry)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_fsunmount_me_t.

◆ rtems_filesystem_default_link()

int rtems_filesystem_default_link ( const rtems_filesystem_location_info_t parentloc,
const rtems_filesystem_location_info_t targetloc,
const char *  name,
size_t  namelen 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_link_t.

◆ rtems_filesystem_default_lock()

void rtems_filesystem_default_lock ( const rtems_filesystem_mount_table_entry_t mt_entry)

Obtains the IO library mutex.

See also
rtems_filesystem_mt_entry_lock_t.

◆ rtems_filesystem_default_mknod()

int rtems_filesystem_default_mknod ( const rtems_filesystem_location_info_t parentloc,
const char *  name,
size_t  namelen,
mode_t  mode,
dev_t  dev 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_mknod_t.

◆ rtems_filesystem_default_mount()

int rtems_filesystem_default_mount ( rtems_filesystem_mount_table_entry_t mt_entry)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_mount_t.

◆ rtems_filesystem_default_readlink()

ssize_t rtems_filesystem_default_readlink ( const rtems_filesystem_location_info_t loc,
char *  buf,
size_t  bufsize 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_readlink_t.

◆ rtems_filesystem_default_rename()

int rtems_filesystem_default_rename ( const rtems_filesystem_location_info_t oldparentloc,
const rtems_filesystem_location_info_t oldloc,
const rtems_filesystem_location_info_t newparentloc,
const char *  name,
size_t  namelen 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_rename_t.

◆ rtems_filesystem_default_rmnod()

int rtems_filesystem_default_rmnod ( const rtems_filesystem_location_info_t parentloc,
const rtems_filesystem_location_info_t loc 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_rmnod_t.

◆ rtems_filesystem_default_statvfs()

int rtems_filesystem_default_statvfs ( const rtems_filesystem_location_info_t loc,
struct statvfs buf 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_statvfs_t.

◆ rtems_filesystem_default_symlink()

int rtems_filesystem_default_symlink ( const rtems_filesystem_location_info_t parentloc,
const char *  name,
size_t  namelen,
const char *  target 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_symlink_t.

◆ rtems_filesystem_default_unlock()

void rtems_filesystem_default_unlock ( const rtems_filesystem_mount_table_entry_t mt_entry)

Releases the IO library mutex.

See also
rtems_filesystem_mt_entry_unlock_t.

◆ rtems_filesystem_default_unmount()

int rtems_filesystem_default_unmount ( rtems_filesystem_mount_table_entry_t mt_entry)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_unmount_t.

◆ rtems_filesystem_default_utime()

int rtems_filesystem_default_utime ( const rtems_filesystem_location_info_t loc,
time_t  actime,
time_t  modtime 
)
Return values
-1Always. The errno is set to ENOTSUP.
See also
rtems_filesystem_utime_t.