Loading...
Searching...
No Matches
List of all members
file_system_module_info Struct Reference

Kernel module interface for file systems. More...

Public Attributes

Data members
struct module_info info
 Your module_info object which is required for all modules.
 
const char * pretty_name
 A NULL-terminated string with a 'pretty' name for you file system.
 
Scanning
float(* identify_partition )(int fd, partition_data *partition, void **_cookie)
 Undocumented. TODO.
 
status_t(* scan_partition )(int fd, partition_data *partition, void *cookie)
 Undocumented. TODO.
 
void(* free_identify_partition_cookie )(partition_data *partition, void *cookie)
 Undocumented. TODO.
 
void(* free_partition_content_cookie )(partition_data *partition)
 Undocumented. TODO.
 
General Operations
status_t(* mount )(fs_volume *volume, const char *device, uint32 flags, const char *args, ino_t *_rootVnodeID)
 Mount a volume according to the specified parameters.
 
Capability Querying
bool(* validate_resize )(partition_data *partition, off_t *size)
 Undocumented. TODO.
 
bool(* validate_move )(partition_data *partition, off_t *start)
 Undocumented. TODO.
 
bool(* validate_set_content_name )(partition_data *partition, char *name)
 Undocumented. TODO.
 
bool(* validate_set_content_parameters )(partition_data *partition, const char *parameters)
 Undocumented. TODO.
 
bool(* validate_initialize )(partition_data *partition, char *name, const char *parameters)
 Undocumented. TODO.
 
Shadow Partition Modification
status_t(* shadow_changed )(partition_data *partition, partition_data *child, uint32 operation)
 Undocumented. TODO.
 
Special Operations
status_t(* defragment )(int fd, partition_id partition, disk_job_id job)
 Undocumented. TODO.
 
status_t(* repair )(int fd, partition_id partition, bool checkOnly, disk_job_id job)
 Undocumented. TODO.
 
status_t(* resize )(int fd, partition_id partition, off_t size, disk_job_id job)
 Undocumented. TODO.
 
status_t(* move )(int fd, partition_id partition, off_t offset, disk_job_id job)
 Undocumented. TODO.
 
status_t(* set_content_name )(int fd, partition_id partition, const char *name, disk_job_id job)
 Undocumented. TODO.
 
status_t(* set_content_parameters )(int fd, partition_id partition, const char *parameters, disk_job_id job)
 Undocumented. TODO.
 
status_t(* initialize )(int fd, partition_id partition, const char *name, const char *parameters, off_t partitionSize, disk_job_id job)
 Undocumented. TODO.
 

Detailed Description

Kernel module interface for file systems.

See the introduction to file system modules for an introduction to writing file systems.

Member Data Documentation

◆ mount

status_t(* file_system_module_info::mount)(fs_volume *volume, const char *device, uint32 flags, const char *args, ino_t *_rootVnodeID)

Mount a volume according to the specified parameters.

Invoked by the VFS when it has been requested to mount the volume. The FS is supposed to perform whatever one-time initialization is necessary for the volume. It is required to create a volume handle for the volume and pass it back in volume->private_volume and set volume->ops to the operation vector for the volume. Moreover it must invoke publish_vnode() for the root node of the volume and pass the ID of the volume back in _rootVnodeID.

A disk-based FS will need to check whether device is not NULL, open it, and analyze whether the device or image file actually represents a volume of that FS type.

If mounting the volume fails for whatever reason, the hook must return an error code other than B_OK. In this case all resources allocated by the hook must be freed before returning. If and only if B_OK is returned, the unmount() hook will be invoked at a later point when unmounting the volume.

Parameters
volumeObject created by the VFS to represent the volume. Its private_volume and ops members must be set by the hooks. All other members are read-only for the FS.
deviceThe path to the device (or image file) representing the volume to be mounted. Can be NULL.
flagsFlags:
  • B_MOUNT_READ_ONLY: Mount the volume read-only.
argsNull-terminated string in driver settings format, containing FS specific parameters.
_rootVnodeIDPointer to a pre-allocated variable the ID of the volume's root directory shall be written to.
Returns
B_OK if everything went fine, another error code otherwise.

◆ pretty_name

const char * file_system_module_info::pretty_name

A NULL-terminated string with a 'pretty' name for you file system.

Note, if a system wide disk device type constant exists for your file system, it should equal this identifier.