pub type vfs_file_system_ops_t = vfs_file_system_ops;
Expand description
@brief Operations on mounted file systems
Similar, but not equal, to struct super_operations in Linux
Aliased Type§
struct vfs_file_system_ops_t {
pub format: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>,
pub mount: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>,
pub umount: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>,
pub rename: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *const u8) -> i32>,
pub unlink: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8) -> i32>,
pub mkdir: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: u32) -> i32>,
pub rmdir: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8) -> i32>,
pub stat: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *mut stat) -> i32>,
pub statvfs: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *mut statvfs) -> i32>,
}
Fields§
§format: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>
@brief Format the file system on the given mount point
@param[in] mountp file system to format
@return 0 on success @return <0 on error
mount: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>
@brief Perform any extra processing needed after mounting a file system
If this call returns an error, the whole vfs_mount call will signal a failure.
All fields of @p mountp will be initialized by vfs_mount beforehand, @c private_data will be initialized to NULL.
@param[in] mountp file system mount being mounted
@return 0 on success @return <0 on error
umount: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct) -> i32>
@brief Perform the necessary clean up for unmounting a file system
@param[in] mountp file system mount being unmounted
@return 0 on success @return <0 on error
rename: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *const u8) -> i32>
@brief Rename a file
The file @p from_path will be renamed to @p to_path
@note it is not possible to rename files across different file system
@param[in] mountp file system mount to operate on @param[in] from_path absolute path to existing file @param[in] to_path absolute path to destination
@return 0 on success @return <0 on error
unlink: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8) -> i32>
@brief Unlink (delete) a file from the file system
@param[in] mountp file system mount to operate on @param[in] name name of the file to delete
@return 0 on success @return <0 on error
mkdir: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: u32) -> i32>
@brief Create a directory on the file system
@param[in] mountp file system mount to operate on @param[in] name name of the directory to create @param[in] mode file creation mode bits
@return 0 on success @return <0 on error
rmdir: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8) -> i32>
@brief Remove a directory from the file system
Only empty directories may be removed.
@param[in] mountp file system mount to operate on @param[in] name name of the directory to remove
@return 0 on success @return <0 on error
stat: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *mut stat) -> i32>
@brief Get file status
@param[in] mountp file system mount to operate on @param[in] path path to file being queried @param[out] buf pointer to stat struct to fill
@return 0 on success @return <0 on error
statvfs: Option<unsafe extern "C" fn(_: *mut vfs_mount_struct, _: *const u8, _: *mut statvfs) -> i32>
@brief Get file system status
@p path is only passed for consistency against the POSIX statvfs function. @c vfs_statvfs calls this function only when it has determined that @p path belongs to this file system. @p path is a file system relative path and does not necessarily name an existing file.
@param[in] mountp file system mount to operate on @param[in] path path to a file on the file system being queried @param[out] buf pointer to statvfs struct to fill
@return 0 on success @return <0 on error
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 36 bytes