MentOS  0.8.0
The Mentoring Operating System
Classes | Macros | Typedefs
vfs_types.h File Reference

Virtual filesystem data types. More...

Go to the source code of this file.

Classes

struct  file_system_type
 Filesystem information. More...
 
struct  vfs_sys_operations_t
 Set of functions used to perform operations on filesystem. More...
 
struct  vfs_file_operations_t
 Set of functions used to perform operations on files. More...
 
struct  vfs_file_t
 Data structure that contains information about the mounted filesystems. More...
 
struct  super_block_t
 A structure that represents an instance of a filesystem, i.e., a mounted filesystem. More...
 
struct  vfs_file_descriptor_t
 Data structure containing information about an open file. More...
 
struct  iattr
 Data structure containing attributes of a file. More...
 

Macros

#define PATH_SEPARATOR   '/'
 The character used as path separator.
 
#define PATH_SEPARATOR_STRING   "/"
 The string used as path separator.
 
#define PATH_UP   ".."
 The path to the parent.
 
#define PATH_DOT   "."
 The path to the current directory.
 
#define ATTR_MODE   (1 << 0)
 Flag set to specify the validity of MODE.
 
#define ATTR_UID   (1 << 1)
 Flag set to specify the validity of UID.
 
#define ATTR_GID   (1 << 2)
 Flag set to specify the validity of GID.
 
#define ATTR_ATIME   (1 << 3)
 Flag set to specify the validity of ATIME.
 
#define ATTR_MTIME   (1 << 4)
 Flag set to specify the validity of MTIME.
 
#define ATTR_CTIME   (1 << 5)
 Flag set to specify the validity of CTIME.
 
#define IATTR_CHOWN(user, group)
 Used to initialize an iattr inside the chown function. More...
 
#define IATTR_CHMOD(mode)
 Used to initialize an iattr inside the chmod function. More...
 

Typedefs

typedef struct vfs_file_t vfs_file_t
 Forward declaration of the VFS file.
 
typedef int(* vfs_mkdir_callback) (const char *, mode_t)
 Function used to create a directory.
 
typedef int(* vfs_rmdir_callback) (const char *)
 Function used to remove a directory.
 
typedef vfs_file_t *(* vfs_creat_callback) (const char *, mode_t)
 Function used to open a file (or directory).
 
typedef ssize_t(* vfs_getdents_callback) (vfs_file_t *, dirent_t *, off_t, size_t)
 Function used to read the entries of a directory.
 
typedef vfs_file_t *(* vfs_open_callback) (const char *, int, mode_t)
 Function used to open a file (or directory).
 
typedef int(* vfs_unlink_callback) (const char *)
 Function used to remove a file.
 
typedef int(* vfs_close_callback) (vfs_file_t *)
 Function used to close a file.
 
typedef ssize_t(* vfs_read_callback) (vfs_file_t *, char *, off_t, size_t)
 Function used to read from a file.
 
typedef ssize_t(* vfs_write_callback) (vfs_file_t *, const void *, off_t, size_t)
 Function used to write inside a file.
 
typedef off_t(* vfs_lseek_callback) (vfs_file_t *, off_t, int)
 Function used to reposition the file offset inside a file.
 
typedef int(* vfs_stat_callback) (const char *, stat_t *)
 Function used to stat fs entries.
 
typedef int(* vfs_fstat_callback) (vfs_file_t *, stat_t *)
 Function used to stat files.
 
typedef int(* vfs_ioctl_callback) (vfs_file_t *, int, void *)
 Function used to perform ioctl on files.
 
typedef int(* vfs_symlink_callback) (const char *, const char *)
 Function for creating symbolic links.
 
typedef ssize_t(* vfs_readlink_callback) (const char *, char *, size_t)
 Function that reads the symbolic link data associated with a file.
 
typedef int(* vfs_setattr_callback) (const char *, struct iattr *)
 Function used to modify the attributes of an fs entry.
 
typedef int(* vfs_fsetattr_callback) (vfs_file_t *, struct iattr *)
 Function used to modify the attributes of a file.
 
typedef struct file_system_type file_system_type
 Filesystem information.
 
typedef struct vfs_sys_operations_t vfs_sys_operations_t
 Set of functions used to perform operations on filesystem.
 
typedef struct vfs_file_operations_t vfs_file_operations_t
 Set of functions used to perform operations on files.
 
typedef struct super_block_t super_block_t
 A structure that represents an instance of a filesystem, i.e., a mounted filesystem.
 
typedef struct vfs_file_descriptor_t vfs_file_descriptor_t
 Data structure containing information about an open file.
 

Detailed Description

Virtual filesystem data types.

Macro Definition Documentation

◆ IATTR_CHMOD

#define IATTR_CHMOD (   mode)
Value:
{ \
.ia_valid = ATTR_MODE, \
.ia_mode = (mode) \
}
#define ATTR_MODE
Flag set to specify the validity of MODE.
Definition: vfs_types.h:195

Used to initialize an iattr inside the chmod function.

◆ IATTR_CHOWN

#define IATTR_CHOWN (   user,
  group 
)
Value:
{ \
.ia_valid = ATTR_UID | ATTR_GID, \
.ia_uid = (user), \
.ia_gid = (group) \
}
Contains user group informations.
Definition: grp.h:14
#define ATTR_GID
Flag set to specify the validity of GID.
Definition: vfs_types.h:197
#define ATTR_UID
Flag set to specify the validity of UID.
Definition: vfs_types.h:196

Used to initialize an iattr inside the chown function.