diff options
author | Karel Zak | 2011-01-19 17:22:28 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-19 17:22:28 +0100 |
commit | 68e9d35c5ee534d0834d13e38cbd85fbb59b7828 (patch) | |
tree | 0b6afad1659f88dbb0cfc0e53a3a895ac4df3ee4 /shlibs/mount | |
parent | build-sys: add rpmatch.h to Makefile.am (diff) | |
download | kernel-qcow2-util-linux-68e9d35c5ee534d0834d13e38cbd85fbb59b7828.tar.gz kernel-qcow2-util-linux-68e9d35c5ee534d0834d13e38cbd85fbb59b7828.tar.xz kernel-qcow2-util-linux-68e9d35c5ee534d0834d13e38cbd85fbb59b7828.zip |
libmount: add mnt_context_is_* functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount')
-rw-r--r-- | shlibs/mount/src/context.c | 93 | ||||
-rw-r--r-- | shlibs/mount/src/mount.h.in | 9 | ||||
-rw-r--r-- | shlibs/mount/src/mount.sym | 10 |
3 files changed, 111 insertions, 1 deletions
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c index 13c5596f8..d71cbb63c 100644 --- a/shlibs/mount/src/context.c +++ b/shlibs/mount/src/context.c @@ -204,6 +204,18 @@ int mnt_context_set_optsmode(mnt_context *cxt, int mode) } /** + * mnt_context_get_optsmode + * @cxt: mount context + * + * Returns: MNT_OMASK_* mask or zero. + */ + +int mnt_context_get_optsmode(mnt_context *cxt) +{ + return cxt ? cxt->optsmode : 0; +} + +/** * mnt_context_disable_canonicalize: * @cxt: mount context * @disable: TRUE or FALSE @@ -238,6 +250,18 @@ int mnt_context_enable_lazy(mnt_context *cxt, int enable) } /** + * mnt_context_is_lazy: + * @cxt: mount context + * + * Returns: 1 if lazy umount is enabled or 0 + */ +int mnt_context_is_lazy(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_LAZY) ? 1 : 0; +} + + +/** * mnt_context_enable_rdonly_umount: * @cxt: mount context * @enable: TRUE or FALSE @@ -253,6 +277,20 @@ int mnt_context_enable_rdonly_umount(mnt_context *cxt, int enable) } /** + * mnt_context_is_rdonly_umount + * @cxt: mount context + * + * See also mnt_context_enable_rdonly_umount() and see umount(8) man page, + * option -r. + * + * Returns: 1 if read-only remount failed umount(2) is enables or 0 + */ +int mnt_context_is_rdonly_umount(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_RDONLY_UMOUNT) ? 1 : 0; +} + +/** * mnt_context_disable_helpers: * @cxt: mount context * @disable: TRUE or FALSE @@ -281,6 +319,17 @@ int mnt_context_enable_sloppy(mnt_context *cxt, int enable) } /** + * mnt_context_is_sloppy: + * @cxt: mount context + * + * Returns: 1 if sloppy flag is enabled or 0 + */ +int mnt_context_is_sloppy(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_SLOPPY) ? 1 : 0; +} + +/** * mnt_context_enable_fake: * @cxt: mount context * @enable: TRUE or FALSE @@ -295,6 +344,17 @@ int mnt_context_enable_fake(mnt_context *cxt, int enable) } /** + * mnt_context_is_fake: + * @cxt: mount context + * + * Returns: 1 if fake flag is enabled or 0 + */ +int mnt_context_is_fake(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_FAKE) ? 1 : 0; +} + +/** * mnt_context_disable_mtab: * @cxt: mount context * @disable: TRUE or FALSE @@ -309,6 +369,17 @@ int mnt_context_disable_mtab(mnt_context *cxt, int disable) } /** + * mnt_context_is_nomtab + * @cxt: mount context + * + * Returns: 1 if no-mtab is enabled or 0 + */ +int mnt_context_is_nomtab(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_NOMTAB) ? 1 : 0; +} + +/** * mnt_context_enable_force: * @cxt: mount context * @enable: TRUE or FALSE @@ -323,6 +394,17 @@ int mnt_context_enable_force(mnt_context *cxt, int enable) } /** + * mnt_context_is_force + * @cxt: mount context + * + * Returns: 1 if force umounting flag is enabled or 0 + */ +int mnt_context_is_force(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_FORCE) ? 1 : 0; +} + +/** * mnt_context_enable_verbose: * @cxt: mount context * @enable: TRUE or FALSE @@ -337,6 +419,17 @@ int mnt_context_enable_verbose(mnt_context *cxt, int enable) } /** + * mnt_context_is_verbose + * @cxt: mount context + * + * Returns: 1 if verbose flag is enabled or 0 + */ +int mnt_context_is_verbose(mnt_context *cxt) +{ + return cxt && (cxt->flags & MNT_FL_VERBOSE) ? 1 : 0; +} + +/** * mnt_context_enable_loopdel: * @cxt: mount context * @enable: TRUE or FALSE diff --git a/shlibs/mount/src/mount.h.in b/shlibs/mount/src/mount.h.in index 199549eb3..828bf7083 100644 --- a/shlibs/mount/src/mount.h.in +++ b/shlibs/mount/src/mount.h.in @@ -345,6 +345,15 @@ extern int mnt_context_enable_force(mnt_context *cxt, int enable); extern int mnt_context_enable_verbose(mnt_context *cxt, int enable); extern int mnt_context_enable_loopdel(mnt_context *cxt, int enable); +extern int mnt_context_get_optsmode(mnt_context *cxt); +extern int mnt_context_is_lazy(mnt_context *cxt); +extern int mnt_context_is_rdonly_umount(mnt_context *cxt); +extern int mnt_context_is_sloppy(mnt_context *cxt); +extern int mnt_context_is_fake(mnt_context *cxt); +extern int mnt_context_is_nomtab(mnt_context *cxt); +extern int mnt_context_is_force(mnt_context *cxt); +extern int mnt_context_is_verbose(mnt_context *cxt); + extern int mnt_context_set_fs(mnt_context *cxt, mnt_fs *fs); extern mnt_fs *mnt_context_get_fs(mnt_context *cxt); extern int mnt_context_set_source(mnt_context *cxt, const char *source); diff --git a/shlibs/mount/src/mount.sym b/shlibs/mount/src/mount.sym index 673f8c80a..3ad4a0210 100644 --- a/shlibs/mount/src/mount.sym +++ b/shlibs/mount/src/mount.sym @@ -28,9 +28,17 @@ global: mnt_context_get_lock; mnt_context_get_mountflags; mnt_context_get_mtab; + mnt_context_get_optsmode; mnt_context_get_status; mnt_context_get_userspace_mountflags; + mnt_context_is_fake; + mnt_context_is_force; + mnt_context_is_lazy; + mnt_context_is_nomtab; + mnt_context_is_rdonly_umount; mnt_context_is_restricted; + mnt_context_is_sloppy; + mnt_context_is_verbose; mnt_context_set_cache; mnt_context_set_fs; mnt_context_set_fstab; @@ -105,6 +113,7 @@ global: mnt_fs_to_mntent; mnt_fstype_is_netfs; mnt_fstype_is_pseudofs; + mnt_get_builtin_optmap; mnt_get_fstab_path; mnt_get_fstype; mnt_get_library_version; @@ -125,7 +134,6 @@ global: mnt_new_tab_from_dir; mnt_new_tab_from_file; mnt_new_update; - mnt_get_builtin_optmap; mnt_optstr_append_option; mnt_optstr_apply_flags; mnt_optstr_get_flags; |