]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: add mnt_context_get_options()
authorKarel Zak <kzak@redhat.com>
Wed, 18 Apr 2012 08:06:35 +0000 (10:06 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Apr 2012 08:06:35 +0000 (10:06 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/docs/libmount-sections.txt
libmount/src/context.c
libmount/src/libmount.h.in
libmount/src/libmount.sym

index 7610be99dc27cb8e51d6cedb601bd75c627de2a7..c29232374dfabedabc85088dd42f3743164357d0 100644 (file)
@@ -21,7 +21,6 @@ mnt_new_context
 mnt_reset_context
 mnt_context_append_options
 mnt_context_apply_fstab
-mnt_context_fstab_applied
 mnt_context_disable_canonicalize
 mnt_context_disable_helpers
 mnt_context_disable_mtab
@@ -33,6 +32,7 @@ mnt_context_enable_loopdel
 mnt_context_enable_rdonly_umount
 mnt_context_enable_sloppy
 mnt_context_enable_verbose
+mnt_context_fstab_applied
 mnt_context_get_cache
 mnt_context_get_fs
 mnt_context_get_fstab
@@ -41,6 +41,7 @@ mnt_context_get_helper_status
 mnt_context_get_lock
 mnt_context_get_mflags
 mnt_context_get_mtab
+mnt_context_get_options
 mnt_context_get_optsmode
 mnt_context_get_source
 mnt_context_get_status
index fe5c3f4bba01b29e5f3f6b1cea0a7cb7856addb7..0d0282de83d8574304c8c2727664fa5a49bc7654 100644 (file)
@@ -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)
 {
@@ -733,6 +733,24 @@ int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr)
        return mnt_fs_append_options(mnt_context_get_fs(cxt), 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
index 245431f27002f260da380b8184d6c23b2f8a256b..6b347f98f7c842918f57c6d6f27168da4bb00ecc 100644 (file)
@@ -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,
index c48b162487d756e66dcb14ac4a84bede752a92ef..4db8b12c6d14be7a3aa88551a26c1d2cef760725 100644 (file)
@@ -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;