| libmount Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
const struct libmnt_optmap * mnt_get_builtin_optmap (int id);
#define MNT_INVERT
#define MNT_NOMTAB
#define MNT_PREFIX
#define MNT_NOHLPS
The mount(2) linux syscall uses two arguments for mount options:
mountflags: (see MS_* macros in linux/fs.h)
mountdata: (usully a comma separated string of options)
The libmount uses options-map(s) to describe mount options.
The option description (map entry) includes:
name: and argument name
id: (in the map unique identifier or a mountflags, e.g MS_RDONLY)
mask: (MNT_INVERT, MNT_NOMTAB)
The option argument value is defined by:
"=" -- required argument, e.g "comment="
"[=]" -- optional argument, e.g. "loop[=]"
Example:
1 2 3 4 5 6 7 8 9 |
#define MY_MS_FOO (1 << 1) #define MY_MS_BAR (1 << 2) libmnt_optmap myoptions[] = { { "foo", MY_MS_FOO }, { "nofoo", MY_MS_FOO | MNT_INVERT }, { "bar=", MY_MS_BAR }, { NULL } }; |
The libmount defines two basic built-in options maps:
MNT_LINUX_MAP: fs-independent kernel mount options (usually MS_* flags)
MNT_USERSPACE_MAP: userspace specific mount options (e.g. "user", "loop")
For more details about option map struct see "struct mnt_optmap" in mount/mount.h.