KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

KOS VFS support for the Second Extended Filesystem. More...

Modules

 Mount Flags
 Mount flags for fs_ext2.
 

Files

file  fs_ext2.h
 VFS interface for an ext2 filesystem.
 

Functions

int fs_ext2_init (void)
 Initialize fs_ext2.
 
int fs_ext2_shutdown (void)
 Shut down fs_ext2.
 
int fs_ext2_mount (const char *mp, kos_blockdev_t *dev, uint32_t flags)
 Mount an ext2 filesystem in the VFS.
 
int fs_ext2_unmount (const char *mp)
 Unmount an ext2 filesystem from the VFS.
 
int fs_ext2_sync (const char *mp)
 Sync an ext2 filesystem, flushing all pending writes to the block device.
 

Detailed Description

KOS VFS support for the Second Extended Filesystem.

Function Documentation

◆ fs_ext2_init()

int fs_ext2_init ( void  )

Initialize fs_ext2.

This function initializes fs_ext2, preparing various internal structures for use.

Return values
0On success. No error conditions currently defined.

◆ fs_ext2_mount()

int fs_ext2_mount ( const char *  mp,
kos_blockdev_t dev,
uint32_t  flags 
)

Mount an ext2 filesystem in the VFS.

This function mounts an ext2 filesystem to the specified mount point on the VFS. This function will detect whether or not an ext2 filesystem exists on the given block device and mount it only if there is actually an ext2 filesystem.

Parameters
mpThe path to mount the filesystem at.
devThe block device containing the filesystem.
flagsMount flags. Bitwise OR of values from ext2_mount_flags
Return values
0On success.
-1On error.

◆ fs_ext2_shutdown()

int fs_ext2_shutdown ( void  )

Shut down fs_ext2.

This function shuts down fs_ext2, basically undoing what fs_ext2_init() did.

Return values
0On success. No error conditions currently defined.

◆ fs_ext2_sync()

int fs_ext2_sync ( const char *  mp)

Sync an ext2 filesystem, flushing all pending writes to the block device.

This function completes all pending writes on the filesystem, making sure all data and metadata are in a consistent state on the block device. As both inode and block writes are normally postponed until they are either evicted from the cache or the filesystem is unmounted, doing this periodically may be a good idea if there is a chance that the filesystem will not be unmounted cleanly.

Note
This function has no effect if the filesystem was mounted read-only.
Parameters
mpThe mount point of the filesystem to be synced.
Return values
0On success.
-1On error.

◆ fs_ext2_unmount()

int fs_ext2_unmount ( const char *  mp)

Unmount an ext2 filesystem from the VFS.

This function unmoutns an ext2 filesystem that was previously mounted by the fs_ext2_mount() function.

Parameters
mpThe mount point of the filesystem to be unmounted.
Return values
0On success.
-1On error.