Chapter 37
NetBSD File Systems: liboskit_netbsd_fs.a

The NetBSD filesystem library consists of the NetBSD filesystem code and a collection of glue code which encapsulates the NetBSD code within the OSKit filesystem framework.

The NetBSD filesystem library provides two additional interfaces:

fs_netbsd_init:
Initialize the NetBSD fs library.
fs_netbsd_mount:
Mount a filesystem via the NetBSD fs library

37.0.6 fs_netbsd_init: Initialize the NetBSD fs library

SYNOPSIS

#include <oskit/fs/netbsd.h>

oskit_error_t fs_netbsd_init(void);

DIRECTION

client OS --> filesystem library

DESCRIPTION

This function initializes the NetBSD fs library, and must be invoked prior to the first call to fs_netbsd_mount. This function only needs to be invoked once by the client operating system.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.

37.0.7 fs_netbsd_mount: Mount a filesystem via the Netbsd fs library

SYNOPSIS

#include <oskit/fs/netbsd.h>

oskit_error_t fs_netbsd_mount(oskit_blkio_t *bio, oskit_u32_t flags, oskit_filesystem_t **out_fs);

DIRECTION

client OS --> filesystem library

DESCRIPTION

This function mounts a FFS filesystem from the partition described by bio, and returns a handle to an oskit_filesystem_t for this filesystem.

This function may be used multiple times by a client operating system to mount multiple file systems.

Note that this function does not graft the filesystem into a namespace; oskit_dir_reparent or other layers may be used for that purpose.

Typically, this interface is not exported to clients, and is only used by the client operating system during initialization.

PARAMETERS
bio:
Describes the partition containing a filesytem. Can be the whole disk like that returned from oskit_linux_block_open, or a subset of one like what is given by diskpart_blkio_lookup_bsd_string.
flags:
The mount flags. These are formed by or’ing the following values:
OSKIT_FS_RDONLY
Read only filesystem
OSKIT_FS_NOEXEC
Can’t exec from filesystem
OSKIT_FS_NOSUID
Don’t honor setuid bits on fs
OSKIT_FS_NODEV
Don’t interpret special files
out_fs:
Upon success, is set to point to an oskit_filesystem_t for this filesystem.
RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.