libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
mountfs.h File Reference

Root Filesystem. More...

#include <libtransistor/fs/inode.h>
Include dependency graph for mountfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

result_t trn_mountfs_create (trn_inode_t *out)
 Create a mountfs filesystem.
 
result_t trn_mountfs_mount_fs (trn_inode_t *fs, const char *name, trn_inode_t mountpoint)
 Mount a filesystem in the MountFS. More...
 

Detailed Description

Root Filesystem.

A MountFS is a pseudo-filesystem capable of mounting other filesystems in it. In libtransistor, this is the default filesystem for the root directory. The Mountfs is organized as a single folder containing one subfolder for each mounted filesystem.

Function Documentation

result_t trn_mountfs_mount_fs ( trn_inode_t fs,
const char *  name,
trn_inode_t  mountpoint 
)

Mount a filesystem in the MountFS.

The given filesystem will then be made available in a folder of the given name. Note that it is not possible to have hierarchies in the mountfs: all filesystems have to be mounted directly at the root of the MountFS.

If successful, this takes ownership of the passed trn_inode_t; it will call the release method automatically when the mountfs itself is released. If anything except RESULT_OK is returned, it is still the caller's responsiblity to release the inode.

The name parameter is copied and does not need to live longer than the invocation of this function.

Parameters
fsThe mountfs to mount under.
nameThe name of the directory to mount under.
mountpointThe filesystem to mount under the mountfs. The mountfs will take ownership of this filesystem.