diff options
author | Karel Zak | 2012-04-18 10:06:35 +0200 |
---|---|---|
committer | Karel Zak | 2012-04-18 10:06:35 +0200 |
commit | 5d451abbbfd495983f9af857fec359681d487858 (patch) | |
tree | ebec172e361a1ecea19ce0cd3118d0e325e8c90a /libmount/src | |
parent | swapon: use only libmount for paths/tags evealuation (diff) | |
download | kernel-qcow2-util-linux-5d451abbbfd495983f9af857fec359681d487858.tar.gz kernel-qcow2-util-linux-5d451abbbfd495983f9af857fec359681d487858.tar.xz kernel-qcow2-util-linux-5d451abbbfd495983f9af857fec359681d487858.zip |
libmount: add mnt_context_get_options()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src')
-rw-r--r-- | libmount/src/context.c | 20 | ||||
-rw-r--r-- | libmount/src/libmount.h.in | 2 | ||||
-rw-r--r-- | libmount/src/libmount.sym | 1 |
3 files changed, 22 insertions, 1 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index fe5c3f4bb..0d0282de8 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -702,7 +702,7 @@ int mnt_context_set_fstype(struct libmnt_context *cxt, const char *fstype) * mnt_context_get_fstype: * @cxt: mount context * - * Returns: returns pointer or NULL in case of error pr if not set. + * Returns: pointer or NULL in case of error pr if not set. */ const char *mnt_context_get_fstype(struct libmnt_context *cxt) { @@ -734,6 +734,24 @@ int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr) } /** + * mnt_context_get_options: + * @cxt: mount context + * + * This function returns mount options set by mnt_context_set_options() or + * mnt_context_append_options(). + * + * Note that *after* mnt_context_prepare_mount() may the mount options string + * also includes options set by mnt_context_set_mflags() or another options + * generated by this library. + * + * Returns: pointer or NULL + */ +const char *mnt_context_get_options(struct libmnt_context *cxt) +{ + return mnt_fs_get_options(mnt_context_get_fs(cxt)); +} + +/** * mnt_context_set_fstype_pattern: * @cxt: mount context * @pattern: FS name pattern (or NULL to reset the current setting) diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in index 245431f27..6b347f98f 100644 --- a/libmount/src/libmount.h.in +++ b/libmount/src/libmount.h.in @@ -445,6 +445,8 @@ extern const char *mnt_context_get_fstype(struct libmnt_context *cxt); extern int mnt_context_set_options(struct libmnt_context *cxt, const char *optstr); extern int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr); +extern const char *mnt_context_get_options(struct libmnt_context *cxt); + extern int mnt_context_set_fstype_pattern(struct libmnt_context *cxt, const char *pattern); extern int mnt_context_set_options_pattern(struct libmnt_context *cxt, diff --git a/libmount/src/libmount.sym b/libmount/src/libmount.sym index c48b16248..4db8b12c6 100644 --- a/libmount/src/libmount.sym +++ b/libmount/src/libmount.sym @@ -231,6 +231,7 @@ global: mnt_fs_streq_target; mnt_fs_streq_srcpath; mnt_context_fstab_applied; + mnt_context_get_options; mnt_context_is_loopdel; mnt_context_is_nocanonicalize; mnt_context_is_nohelpers; |