Loading...
Searching...
No Matches
vfs_file_system_ops Struct Reference

Operations on mounted file systems. More...

Detailed Description

Operations on mounted file systems.

Similar, but not equal, to struct super_operations in Linux

Definition at line 623 of file vfs.h.

#include <vfs.h>

Data Fields

int(* format )(vfs_mount_t *mountp)
 Format the file system on the given mount point.
 
int(* mount )(vfs_mount_t *mountp)
 Perform any extra processing needed after mounting a file system.
 
int(* umount )(vfs_mount_t *mountp)
 Perform the necessary clean up for unmounting a file system.
 
int(* rename )(vfs_mount_t *mountp, const char *from_path, const char *to_path)
 Rename a file.
 
int(* unlink )(vfs_mount_t *mountp, const char *name)
 Unlink (delete) a file from the file system.
 
int(* mkdir )(vfs_mount_t *mountp, const char *name, mode_t mode)
 Create a directory on the file system.
 
int(* rmdir )(vfs_mount_t *mountp, const char *name)
 Remove a directory from the file system.
 
int(* stat )(vfs_mount_t *mountp, const char *restrict path, struct stat *restrict buf)
 Get file status.
 
int(* statvfs )(vfs_mount_t *mountp, const char *restrict path, struct statvfs *restrict buf)
 Get file system status.
 

Field Documentation

◆ format

int(* vfs_file_system_ops::format) (vfs_mount_t *mountp)

Format the file system on the given mount point.

Parameters
[in]mountpfile system to format
Returns
0 on success
<0 on error

Definition at line 632 of file vfs.h.

◆ mkdir

int(* vfs_file_system_ops::mkdir) (vfs_mount_t *mountp, const char *name, mode_t mode)

Create a directory on the file system.

Parameters
[in]mountpfile system mount to operate on
[in]namename of the directory to create
[in]modefile creation mode bits
Returns
0 on success
<0 on error

Definition at line 697 of file vfs.h.

◆ mount

int(* vfs_file_system_ops::mount) (vfs_mount_t *mountp)

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 mountp will be initialized by vfs_mount beforehand, private_data will be initialized to NULL.

Parameters
[in]mountpfile system mount being mounted
Returns
0 on success
<0 on error

Definition at line 648 of file vfs.h.

◆ rename

int(* vfs_file_system_ops::rename) (vfs_mount_t *mountp, const char *from_path, const char *to_path)

Rename a file.

The file from_path will be renamed to to_path

Note
it is not possible to rename files across different file system
Parameters
[in]mountpfile system mount to operate on
[in]from_pathabsolute path to existing file
[in]to_pathabsolute path to destination
Returns
0 on success
<0 on error

Definition at line 674 of file vfs.h.

◆ rmdir

int(* vfs_file_system_ops::rmdir) (vfs_mount_t *mountp, const char *name)

Remove a directory from the file system.

Only empty directories may be removed.

Parameters
[in]mountpfile system mount to operate on
[in]namename of the directory to remove
Returns
0 on success
<0 on error

Definition at line 710 of file vfs.h.

◆ stat

int(* vfs_file_system_ops::stat) (vfs_mount_t *mountp, const char *restrict path, struct stat *restrict buf)

Get file status.

Parameters
[in]mountpfile system mount to operate on
[in]pathpath to file being queried
[out]bufpointer to stat struct to fill
Returns
0 on success
<0 on error

Definition at line 722 of file vfs.h.

◆ statvfs

int(* vfs_file_system_ops::statvfs) (vfs_mount_t *mountp, const char *restrict path, struct statvfs *restrict buf)

Get file system status.

path is only passed for consistency against the POSIX statvfs function. vfs_statvfs calls this function only when it has determined that path belongs to this file system. path is a file system relative path and does not necessarily name an existing file.

Parameters
[in]mountpfile system mount to operate on
[in]pathpath to a file on the file system being queried
[out]bufpointer to statvfs struct to fill
Returns
0 on success
<0 on error

Definition at line 739 of file vfs.h.

◆ umount

int(* vfs_file_system_ops::umount) (vfs_mount_t *mountp)

Perform the necessary clean up for unmounting a file system.

Parameters
[in]mountpfile system mount being unmounted
Returns
0 on success
<0 on error

Definition at line 658 of file vfs.h.

◆ unlink

int(* vfs_file_system_ops::unlink) (vfs_mount_t *mountp, const char *name)

Unlink (delete) a file from the file system.

Parameters
[in]mountpfile system mount to operate on
[in]namename of the file to delete
Returns
0 on success
<0 on error

Definition at line 685 of file vfs.h.


The documentation for this struct was generated from the following file: