RTEMS 6.1-rc5
|
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_readlink.c |
RTEMS Default Filesystem - Default Readlink. | |
file | default_rename.c |
RTEMS Default File System Rename Files. | |
file | default_rmnod.c |
RTEMS Default Filesystem - Default Remove Node. | |
file | default_symlink.c |
RTEMS Default File System creates a symbolic link to a file. | |
file | default_unmount.c |
RTEMS Default File System Unmounts. | |
file | default_utimens.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. | |
typedef void(* | rtems_filesystem_mt_entry_unlock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry) |
Unlocks a file system instance. | |
typedef void(* | rtems_filesystem_eval_path_t) (rtems_filesystem_eval_path_context_t *ctx) |
Path evaluation. | |
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. | |
typedef int(* | rtems_filesystem_fchmod_t) (const rtems_filesystem_location_info_t *loc, mode_t mode) |
Changes the mode of a node. | |
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. | |
typedef int(* | rtems_filesystem_clonenode_t) (rtems_filesystem_location_info_t *loc) |
Clones a location. | |
typedef void(* | rtems_filesystem_freenode_t) (const rtems_filesystem_location_info_t *loc) |
Frees the location of a node. | |
typedef int(* | rtems_filesystem_mount_t) (rtems_filesystem_mount_table_entry_t *mt_entry) |
Mounts a file system instance in a mount point (directory). | |
typedef int(* | rtems_filesystem_fsmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data) |
Initializes a file system instance. | |
typedef int(* | rtems_filesystem_unmount_t) (rtems_filesystem_mount_table_entry_t *mt_entry) |
Unmounts a file system instance in a mount point (directory). | |
typedef void(* | rtems_filesystem_fsunmount_me_t) (rtems_filesystem_mount_table_entry_t *mt_entry) |
Destroys a file system instance. | |
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. | |
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. | |
typedef int(* | rtems_filesystem_rmnod_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc) |
Removes a node. | |
typedef int(* | rtems_filesystem_utimens_t) (const rtems_filesystem_location_info_t *loc, struct timespec times[2]) |
Set node access and modification times. | |
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. | |
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. | |
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. | |
typedef int(* | rtems_filesystem_statvfs_t) (const rtems_filesystem_location_info_t *loc, struct statvfs *buf) |
Gets file system information. | |
Variables | |
const rtems_filesystem_operations_table | rtems_filesystem_operations_default |
File system operations table with default operations. | |
File system operations.
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.
[in] | a | The one location. |
[in] | b | The other location. |
true | The nodes of the locations are equal. |
false | Otherwise. |
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.
[in] | loc | The location of the node. |
[in] | owner | User ID for the node. |
[in] | group | Group ID for the node. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in,out] | loc | Location to clone. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef void(* rtems_filesystem_eval_path_t) (rtems_filesystem_eval_path_context_t *ctx) |
Path evaluation.
[in,out] | ctx | The path evaluation context. |
typedef int(* rtems_filesystem_fchmod_t) (const rtems_filesystem_location_info_t *loc, mode_t mode) |
Changes the mode of a node.
[in] | loc | The location of the node. |
[in] | mode | The new mode of the node |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef void(* rtems_filesystem_freenode_t) (const rtems_filesystem_location_info_t *loc) |
Frees the location of a node.
[in] | loc | The location of the node. |
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.
[in] | mt_entry | The mount table entry. |
[in] | data | The data provided by the user. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | mt_entry | The mount table entry. |
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.
[in] | parentloc | The location of the parent of the new link. |
[in] | targetloc | The location of the target file. |
[in] | name | Name for the new link. |
[in] | namelen | Length of the name for the new link in characters. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | parentloc | The location of the parent of the new node. |
[in] | name | Name for the new node. |
[in] | namelen | Length of the name for the new node in characters. |
[in] | mode | Mode for the new node. |
[in] | dev | Optional device identifier for the new node. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | mt_entry | The mount table entry. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in,out] | mt_entry | The mount table entry of the file system instance. |
typedef void(* rtems_filesystem_mt_entry_unlock_t) (const rtems_filesystem_mount_table_entry_t *mt_entry) |
Unlocks a file system instance.
[in,out] | mt_entry | The mount table entry of the file system instance. |
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.
[in] | loc | The location of the symbolic link. |
[out] | buf | The buffer for the contents. |
[in] | bufsize | The size of the buffer in characters. |
non-negative | Size of the actual contents in characters. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | oldparentloc | The location of the parent of the old node. |
[in] | oldloc | The location of the old node. |
[in] | newparentloc | The location of the parent of the new node. |
[in] | name | Name for the new node. |
[in] | namelen | Length of the name for the new node in characters. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_rmnod_t) (const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc) |
Removes a node.
[in] | parentloc | The location of the parent of the node. |
[in] | loc | The location of the node. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_statvfs_t) (const rtems_filesystem_location_info_t *loc, struct statvfs *buf) |
Gets file system information.
[in] | loc | The location of a node. |
[out] | buf | Buffer for file system information. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | parentloc | The location of the parent of the new symbolic link. |
[in] | name | Name for the new symbolic link. |
[in] | namelen | Length of the name for the new symbolic link in characters. |
[in] | target | Contents for the symbolic link. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | mt_entry | The mount table entry. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_utimens_t) (const rtems_filesystem_location_info_t *loc, struct timespec times[2]) |
Set node access and modification times.
[in] | loc | The location of the node. |
[in] | times | Access and modification times for the node |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
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.
[in] | a | The one location. |
[in] | b | The other location. |
true | The node access pointers of the locations are equal. |
false | Otherwise. |
int rtems_filesystem_default_chown | ( | const rtems_filesystem_location_info_t * | loc, |
uid_t | owner, | ||
gid_t | group | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_clonenode | ( | rtems_filesystem_location_info_t * | loc | ) |
0 | Always. |
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.
int rtems_filesystem_default_fchmod | ( | const rtems_filesystem_location_info_t * | loc, |
mode_t | mode | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
void rtems_filesystem_default_freenode | ( | const rtems_filesystem_location_info_t * | loc | ) |
void rtems_filesystem_default_fsunmount | ( | rtems_filesystem_mount_table_entry_t * | mt_entry | ) |
-1 | Always. The errno is set to ENOTSUP. |
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 | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
void rtems_filesystem_default_lock | ( | const rtems_filesystem_mount_table_entry_t * | mt_entry | ) |
Obtains the IO library mutex.
int rtems_filesystem_default_mknod | ( | const rtems_filesystem_location_info_t * | parentloc, |
const char * | name, | ||
size_t | namelen, | ||
mode_t | mode, | ||
dev_t | dev | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_mount | ( | rtems_filesystem_mount_table_entry_t * | mt_entry | ) |
-1 | Always. The errno is set to ENOTSUP. |
ssize_t rtems_filesystem_default_readlink | ( | const rtems_filesystem_location_info_t * | loc, |
char * | buf, | ||
size_t | bufsize | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
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 | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_rmnod | ( | const rtems_filesystem_location_info_t * | parentloc, |
const rtems_filesystem_location_info_t * | loc | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_statvfs | ( | const rtems_filesystem_location_info_t * | loc, |
struct statvfs * | buf | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_symlink | ( | const rtems_filesystem_location_info_t * | parentloc, |
const char * | name, | ||
size_t | namelen, | ||
const char * | target | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
void rtems_filesystem_default_unlock | ( | const rtems_filesystem_mount_table_entry_t * | mt_entry | ) |
Releases the IO library mutex.
int rtems_filesystem_default_unmount | ( | rtems_filesystem_mount_table_entry_t * | mt_entry | ) |
-1 | Always. The errno is set to ENOTSUP. |
int rtems_filesystem_default_utimens | ( | const rtems_filesystem_location_info_t * | loc, |
struct timespec | times[2] | ||
) |
-1 | Always. The errno is set to ENOTSUP. |