The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
ext2_ops.h File Reference

Go to the source code of this file.

Typedefs

typedef struct fs_mount fs_mount_t
 filesystem operations vtable.

Functions

kerr_t ext2_ops_mount (fs_mount_t *mount, block_device_t *device)
 initialize an ext2 filesystem on a block device and install its operations vtable on the mount.

Typedef Documentation

◆ fs_mount_t

typedef struct fs_mount fs_mount_t

filesystem operations vtable.

each filesystem type (ext2 today; procfs/tmpfs/FAT32 later) provides one of these so the generic fs_* layer never names a concrete filesystem. a mount points at its filesystem's ops; every open file carries the same pointer so file-level calls dispatch without consulting the mount again.

mount is the only entry point that is not in the vtable: fs_mount() selects the filesystem (currently always ext2) and installs its ops.

Function Documentation

◆ ext2_ops_mount()

kerr_t ext2_ops_mount ( fs_mount_t * mount,
block_device_t * device )

initialize an ext2 filesystem on a block device and install its operations vtable on the mount.

after this succeeds, all access goes through mount->ops.

Parameters
mountfilesystem mount object to initialize.
deviceinitialized block device backend.
Returns
KERR_OK on success, or an error code on failure.