]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: don't export functions for vfs/fs/userspace mount options
authorKarel Zak <kzak@redhat.com>
Tue, 22 Feb 2011 17:41:20 +0000 (18:41 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 22 Feb 2011 17:41:20 +0000 (18:41 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/mount/src/context.c
shlibs/mount/src/context_mount.c
shlibs/mount/src/context_umount.c
shlibs/mount/src/fs.c
shlibs/mount/src/libmount.h.in
shlibs/mount/src/libmount.sym
shlibs/mount/src/mountP.h
shlibs/mount/src/tab_parse.c
shlibs/mount/src/tab_update.c

index 487859a3f9664c28a2f4f530684c21a9a69d03de..f8db3cfd674b0869661507545afdd6a0dd12a238 100644 (file)
@@ -1376,36 +1376,14 @@ static int apply_table(struct libmnt_context *cxt, struct libmnt_table *tb,
 
        if (cxt->optsmode & MNT_OMODE_IGNORE)
                ;
-       else if (cxt->optsmode & MNT_OMODE_REPLACE) {
-               rc = mnt_fs_set_vfs_options(cxt->fs,
-                                       mnt_fs_get_vfs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_set_fs_options(cxt->fs,
-                                       mnt_fs_get_fs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_set_user_options(cxt->fs,
-                                       mnt_fs_get_user_options(fs));
+       else if (cxt->optsmode & MNT_OMODE_REPLACE)
+               rc = mnt_fs_set_options(cxt->fs, mnt_fs_get_options(fs));
 
-       } else if (cxt->optsmode & MNT_OMODE_APPEND) {
-               rc = mnt_fs_append_vfs_options(cxt->fs,
-                                       mnt_fs_get_vfs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_append_fs_options(cxt->fs,
-                                       mnt_fs_get_fs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_append_user_options(cxt->fs,
-                                       mnt_fs_get_user_options(fs));
+       else if (cxt->optsmode & MNT_OMODE_APPEND)
+               rc = mnt_fs_append_options(cxt->fs, mnt_fs_get_options(fs));
 
-       } else if (cxt->optsmode & MNT_OMODE_PREPEND) {
-               rc = mnt_fs_prepend_vfs_options(cxt->fs,
-                                       mnt_fs_get_vfs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_prepend_fs_options(cxt->fs,
-                                       mnt_fs_get_fs_options(fs));
-               if (!rc)
-                       rc = mnt_fs_prepend_user_options(cxt->fs,
-                                       mnt_fs_get_user_options(fs));
-       }
+       else if (cxt->optsmode & MNT_OMODE_PREPEND)
+               rc = mnt_fs_prepend_options(cxt->fs, mnt_fs_get_options(fs));
 
        if (!rc)
                cxt->flags |= MNT_FL_TAB_APPLIED;
index 0c67546444bf413f8f0f0ed392c886f3124edcb5..647e2614937162ad97c42f19f5afe95ac1a143c3 100644 (file)
@@ -109,10 +109,14 @@ static int fix_optstr(struct libmnt_context *cxt)
        if (!rc && cxt->user_mountflags && MNT_MS_USER)
                rc = mnt_optstr_fix_user(&fs->user_optstr);
 
+       /* refresh merged optstr */
+       free(fs->optstr);
+       fs->optstr = NULL;
+       fs->optstr = mnt_fs_strdup_options(fs);
 done:
        DBG(CXT, mnt_debug_h(cxt, "fixed options [rc=%d]: "
-               "vfs: '%s' fs: '%s' user: '%s'", rc,
-               fs->vfs_optstr, fs->fs_optstr, fs->user_optstr));
+               "vfs: '%s' fs: '%s' user: '%s', optstr: '%s'", rc,
+               fs->vfs_optstr, fs->fs_optstr, fs->user_optstr, fs->optstr));
        return rc;
 }
 
index 1187a87cd71246d5d4f22df9f1ee05a4fb65ffea..3bf8fc45eea9bceef11af3f98535939392b2b038 100644 (file)
@@ -591,7 +591,7 @@ int mnt_context_do_umount(struct libmnt_context *cxt)
                /*
                 * fix options, remount --> read-only mount
                 */
-               const char *o = mnt_fs_get_vfs_options(cxt->fs);
+               const char *o = mnt_fs_get_options(cxt->fs);
                char *n = o ? strdup(o) : NULL;
 
                DBG(CXT, mnt_debug_h(cxt, "fix remount-on-umount update"));
@@ -600,7 +600,7 @@ int mnt_context_do_umount(struct libmnt_context *cxt)
                        mnt_optstr_remove_option(&n, "rw");
                rc = mnt_optstr_prepend_option(&n, "ro", NULL);
                if (!rc)
-                       rc = mnt_fs_set_vfs_options(cxt->fs, n);
+                       rc = mnt_fs_set_options(cxt->fs, n);
 
                /* use "remount" instead of "umount" in /etc/mtab */
                if (!rc && cxt->update && cxt->mtab_writable)
index c2deff5f1f992561c5935fb3b27aaff3e99c8446..75ec4b4766e8dd81b6124bc2af7dfeb19cd5d7c4 100644 (file)
@@ -59,6 +59,7 @@ void mnt_free_fs(struct libmnt_fs *fs)
        free(fs->root);
        free(fs->target);
        free(fs->fstype);
+       free(fs->optstr);
        free(fs->vfs_optstr);
        free(fs->fs_optstr);
        free(fs->user_optstr);
@@ -154,6 +155,8 @@ struct libmnt_fs *mnt_copy_fs(struct libmnt_fs *dest,
                goto err;
        if (cpy_str_at_offset(dest, src, offsetof(struct libmnt_fs, fstype)))
                goto err;
+       if (cpy_str_at_offset(dest, src, offsetof(struct libmnt_fs, optstr)))
+               goto err;
        if (cpy_str_at_offset(dest, src, offsetof(struct libmnt_fs, vfs_optstr)))
                goto err;
        if (cpy_str_at_offset(dest, src, offsetof(struct libmnt_fs, fs_optstr)))
@@ -214,6 +217,10 @@ struct libmnt_fs *mnt_copy_mtab_fs(const struct libmnt_fs *fs)
        if (cpy_str_at_offset(n, fs, offsetof(struct libmnt_fs, fs_optstr)))
                goto err;
 
+       /* we cannot copy original optstr, the new optstr has to be without
+        * non-mtab options -- so, let's generate a new string */
+       n->optstr = mnt_fs_strdup_options(n);
+
        n->freq       = fs->freq;
        n->passno     = fs->passno;
        n->flags      = fs->flags;
@@ -583,6 +590,10 @@ char *mnt_fs_strdup_options(struct libmnt_fs *fs)
        assert(fs);
 
        errno = 0;
+
+       if (fs->optstr)
+               return strdup(fs->optstr);
+
        res = merge_optstr(fs->vfs_optstr, fs->fs_optstr);
        if (!res && errno)
                return NULL;
@@ -595,6 +606,19 @@ char *mnt_fs_strdup_options(struct libmnt_fs *fs)
        return res;
 }
 
+/**
+ * mnt_fs_get_options:
+ * @fs: fstab/mtab/mountinfo entry pointer
+ *
+ * Returns: pointer to string or NULL in case of error.
+ */
+const char *mnt_fs_get_options(struct libmnt_fs *fs)
+{
+       assert(fs);
+       return fs ? fs->optstr : NULL;
+}
+
+
 /**
  * mnt_fs_set_options:
  * @fs: fstab/mtab/mountinfo entry pointer
@@ -607,7 +631,7 @@ char *mnt_fs_strdup_options(struct libmnt_fs *fs)
  */
 int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr)
 {
-       char *v = NULL, *f = NULL, *u = NULL;
+       char *v = NULL, *f = NULL, *u = NULL, *n = NULL;
 
        assert(fs);
 
@@ -617,15 +641,21 @@ int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr)
                int rc = mnt_split_optstr(optstr, &u, &v, &f, 0, 0);
                if (rc)
                        return rc;
+               n = strdup(optstr);
+               if (!n)
+                       return -ENOMEM;
        }
 
        free(fs->fs_optstr);
        free(fs->vfs_optstr);
        free(fs->user_optstr);
+       free(fs->optstr);
 
        fs->fs_optstr = f;
        fs->vfs_optstr = v;
        fs->user_optstr = u;
+       fs->optstr = n;
+
        return 0;
 }
 
@@ -657,9 +687,15 @@ int mnt_fs_append_options(struct libmnt_fs *fs, const char *optstr)
        if (!rc && v)
                rc = mnt_optstr_append_option(&fs->vfs_optstr, v, NULL);
        if (!rc && f)
-              rc = mnt_optstr_append_option(&fs->fs_optstr, f, NULL);
+               rc = mnt_optstr_append_option(&fs->fs_optstr, f, NULL);
        if (!rc && u)
-              rc = mnt_optstr_append_option(&fs->user_optstr, u, NULL);
+               rc = mnt_optstr_append_option(&fs->user_optstr, u, NULL);
+       if (!rc)
+               rc = mnt_optstr_append_option(&fs->optstr, optstr, NULL);
+
+       free(v);
+       free(f);
+       free(u);
 
        return rc;
 }
@@ -695,6 +731,12 @@ int mnt_fs_prepend_options(struct libmnt_fs *fs, const char *optstr)
                rc = mnt_optstr_prepend_option(&fs->fs_optstr, f, NULL);
        if (!rc && u)
                rc = mnt_optstr_prepend_option(&fs->user_optstr, u, NULL);
+       if (!rc)
+               rc = mnt_optstr_prepend_option(&fs->optstr, optstr, NULL);
+
+       free(v);
+       free(f);
+       free(u);
 
        return rc;
 }
@@ -711,71 +753,6 @@ const char *mnt_fs_get_fs_options(struct libmnt_fs *fs)
        return fs ? fs->fs_optstr : NULL;
 }
 
-/**
- * mnt_fs_set_fs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Sets FS specific mount options.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_set_fs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       char *p = NULL;
-
-       if (!fs)
-               return -EINVAL;
-       if (optstr) {
-               p = strdup(optstr);
-               if (!p)
-                       return -ENOMEM;
-       }
-       free(fs->fs_optstr);
-       fs->fs_optstr = p;
-
-       return 0;
-}
-
-/**
- * mnt_fs_append_fs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Appends FS specific mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_append_fs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-       return mnt_optstr_append_option(&fs->fs_optstr, optstr, NULL);
-}
-
-/**
- * mnt_fs_prepend_fs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Prepends FS specific mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_prepend_fs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-       return mnt_optstr_prepend_option(&fs->fs_optstr, optstr, NULL);
-}
-
-
 /**
  * mnt_fs_get_vfs_options:
  * @fs: fstab/mtab entry pointer
@@ -788,70 +765,6 @@ const char *mnt_fs_get_vfs_options(struct libmnt_fs *fs)
        return fs ? fs->vfs_optstr : NULL;
 }
 
-/**
- * mnt_fs_set_vfs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Sets VFS mount options.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_set_vfs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       char *p = NULL;
-
-       if (!fs)
-               return -EINVAL;
-       if (optstr) {
-               p = strdup(optstr);
-               if (!p)
-                       return -ENOMEM;
-       }
-       free(fs->vfs_optstr);
-       fs->vfs_optstr = p;
-
-       return 0;
-}
-
-/**
- * mnt_fs_append_vfs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Appends VFS mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_append_vfs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-       return mnt_optstr_append_option(&fs->vfs_optstr, optstr, NULL);
-}
-
-/**
- * mnt_fs_prepend_vfs_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Prepends VFS mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_prepend_vfs_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-       return mnt_optstr_prepend_option(&fs->vfs_optstr, optstr, NULL);
-}
-
 /**
  * mnt_fs_get_user_options:
  * @fs: fstab/mtab entry pointer
@@ -864,71 +777,6 @@ const char *mnt_fs_get_user_options(struct libmnt_fs *fs)
        return fs ? fs->user_optstr : NULL;
 }
 
-/**
- * mnt_fs_set_user_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Sets userspace mount options.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_set_user_options(struct libmnt_fs *fs, const char *optstr)
-{
-       char *p = NULL;
-
-       if (!fs)
-               return -EINVAL;
-       if (optstr) {
-               p = strdup(optstr);
-               if (!p)
-                       return -ENOMEM;
-       }
-       free(fs->user_optstr);
-       fs->user_optstr = p;
-
-       return 0;
-}
-
-/**
- * mnt_fs_append_user_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Appends userspace mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_append_user_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-       return mnt_optstr_append_option(&fs->user_optstr, optstr, NULL);
-}
-
-/**
- * mnt_fs_prepend_user_options:
- * @fs: fstab/mtab/mountinfo entry
- * @optstr: options string
- *
- * Prepends userspace mount options. If @optstr is NULL then @fs is not
- * modified and 0 is returned.
- *
- * Returns: 0 on success or negative number in case of error.
- */
-int mnt_fs_prepend_user_options(struct libmnt_fs *fs, const char *optstr)
-{
-       if (!fs)
-               return -EINVAL;
-       if (!optstr)
-               return 0;
-
-       return mnt_optstr_prepend_option(&fs->user_optstr, optstr, NULL);
-}
-
 /**
  * mnt_fs_get_attributes:
  * @fs: fstab/mtab entry pointer
@@ -1384,6 +1232,8 @@ int mnt_fs_print_debug(struct libmnt_fs *fs, FILE *file)
        fprintf(file, "target: %s\n", mnt_fs_get_target(fs));
        fprintf(file, "fstype: %s\n", mnt_fs_get_fstype(fs));
 
+       if (mnt_fs_get_options(fs))
+               fprintf(file, "optstr: %s\n", mnt_fs_get_options(fs));
        if (mnt_fs_get_vfs_options(fs))
                fprintf(file, "VFS-optstr: %s\n", mnt_fs_get_vfs_options(fs));
        if (mnt_fs_get_fs_options(fs))
index 1831ed18a92c8dfe808e8a2ad1a5846913d58865..cb0a28aee9b6490945c81d7ae0d0fafee994b2ff 100644 (file)
@@ -215,28 +215,18 @@ extern const char *mnt_fs_get_fstype(struct libmnt_fs *fs);
 extern int mnt_fs_set_fstype(struct libmnt_fs *fs, const char *fstype);
 
 extern char *mnt_fs_strdup_options(struct libmnt_fs *fs);
+extern const char *mnt_fs_get_options(struct libmnt_fs *fs);
 extern int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr);
+extern int mnt_fs_append_options(struct libmnt_fs *fs, const char *optstr);
+extern int mnt_fs_prepend_options(struct libmnt_fs *fs, const char *optstr);
 
 extern int mnt_fs_get_option(struct libmnt_fs *fs, const char *name,
                                char **value, size_t *valsz);
 
-extern int mnt_fs_append_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_prepend_options(struct libmnt_fs *fs, const char *optstr);
 
 extern const char *mnt_fs_get_fs_options(struct libmnt_fs *fs);
-extern int mnt_fs_set_fs_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_append_fs_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_prepend_fs_options(struct libmnt_fs *fs, const char *optstr);
-
 extern const char *mnt_fs_get_vfs_options(struct libmnt_fs *fs);
-extern int mnt_fs_set_vfs_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_append_vfs_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_prepend_vfs_options(struct libmnt_fs *fs, const char *optstr);
-
 extern const char *mnt_fs_get_user_options(struct libmnt_fs *fs);
-extern int mnt_fs_set_user_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_append_user_options(struct libmnt_fs *fs, const char *optstr);
-extern int mnt_fs_prepend_user_options(struct libmnt_fs *fs, const char *optstr);
 
 extern const char *mnt_fs_get_attributes(struct libmnt_fs *fs);
 extern int mnt_fs_set_attributes(struct libmnt_fs *fs, const char *optstr);
index d0ebfd728effa7e7abe95671b44358d3965cee59..f8a5345b04c65c41a76a7b8009e1d74a94e1ac70 100644 (file)
@@ -75,10 +75,7 @@ global:
        mnt_free_table;
        mnt_free_update;
        mnt_fs_append_attributes;
-       mnt_fs_append_fs_options;
        mnt_fs_append_options;
-       mnt_fs_append_user_options;
-       mnt_fs_append_vfs_options;
        mnt_fs_get_attribute;
        mnt_fs_get_attributes;
        mnt_fs_get_bindsrc;
@@ -88,6 +85,7 @@ global:
        mnt_fs_get_fstype;
        mnt_fs_get_id;
        mnt_fs_get_option;
+       mnt_fs_get_options;
        mnt_fs_get_parent_id;
        mnt_fs_get_passno;
        mnt_fs_get_root;
@@ -104,15 +102,11 @@ global:
        mnt_fs_match_source;
        mnt_fs_match_target;
        mnt_fs_prepend_attributes;
-       mnt_fs_prepend_fs_options;
        mnt_fs_prepend_options;
-       mnt_fs_prepend_user_options;
-       mnt_fs_prepend_vfs_options;
        mnt_fs_print_debug;
        mnt_fs_set_attributes;
        mnt_fs_set_bindsrc;
        mnt_fs_set_freq;
-       mnt_fs_set_fs_options;
        mnt_fs_set_fstype;
        mnt_fs_set_options;
        mnt_fs_set_passno;
@@ -120,8 +114,6 @@ global:
        mnt_fs_set_source;
        mnt_fs_set_target;
        mnt_fs_set_userdata;
-       mnt_fs_set_user_options;
-       mnt_fs_set_vfs_options;
        mnt_fs_strdup_options;
        mnt_fs_to_mntent;
        mnt_fstype_is_netfs;
index 71314a542ed5eaa376911250cf8c6d5b2c8e7e2f..0d773ba0a2b58fecb0fa45aa75c2a7f15f6e8788 100644 (file)
@@ -174,6 +174,7 @@ struct libmnt_fs {
        char            *target;        /* mountinfo[5], fstab[2]: mountpoint */
        char            *fstype;        /* mountinfo[9], fstab[3]: filesystem type */
 
+       char            *optstr;        /* fstab[4], merged options */
        char            *vfs_optstr;    /* mountinfo[6]: fs-independent (VFS) options */
        char            *fs_optstr;     /* mountinfo[11]: fs-depend options */
        char            *user_optstr;   /* userspace mount options */
index 4eb32eb63dc267b3242047c802194739d27d6308..cd4e348971dec9255b0b0ea6b66519ab1046b60d 100644 (file)
@@ -163,6 +163,11 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
                rc = __mnt_fs_set_fstype_ptr(fs, fstype);
                if (!rc)
                        rc = __mnt_fs_set_source_ptr(fs, src);
+
+               /* merge VFS and FS options to the one string */
+               fs->optstr = mnt_fs_strdup_options(fs);
+               if (!fs->optstr)
+                       rc = -ENOMEM;
        } else {
                DBG(TAB, mnt_debug(
                        "mountinfo parse error [sscanf rc=%d]: '%s'", rc, s));
@@ -651,7 +656,7 @@ static struct libmnt_fs *mnt_table_merge_user_fs(struct libmnt_table *tb, struct
 
        if (fs) {
                DBG(TAB, mnt_debug_h(tb, "found fs -- appending user optstr"));
-               mnt_fs_append_user_options(fs, optstr);
+               mnt_fs_append_options(fs, optstr);
                mnt_fs_append_attributes(fs, attrs);
                mnt_fs_set_bindsrc(fs, mnt_fs_get_bindsrc(uf));
                fs->flags |= MNT_FS_MERGED;
index 5373e2fa20b6eaf665e94300040b87c83d57c3df..47a3e5fe917ec64de7d736a28f82c607c1c5ecb8 100644 (file)
@@ -264,13 +264,13 @@ int mnt_update_force_rdonly(struct libmnt_update *upd, int rdonly)
 
        if (!upd->userspace_only) {
                /* /etc/mtab -- we care about VFS options there */
-               const char *o = mnt_fs_get_vfs_options(upd->fs);
+               const char *o = mnt_fs_get_options(upd->fs);
                char *n = o ? strdup(o) : NULL;
 
                if (n)
                        mnt_optstr_remove_option(&n, rdonly ? "rw" : "ro");
                if (!mnt_optstr_prepend_option(&n, rdonly ? "ro" : "rw", NULL))
-                       rc = mnt_fs_set_vfs_options(upd->fs, n);
+                       rc = mnt_fs_set_options(upd->fs, n);
 
                free(n);
        }
@@ -330,7 +330,7 @@ static int utab_new_entry(struct libmnt_fs *fs, unsigned long mountflags, struct
                goto err;
        }
 
-       rc = mnt_fs_set_user_options(*ent, u);
+       rc = mnt_fs_set_options(*ent, u);
        if (rc)
                goto err;
        rc = mnt_fs_set_attributes(*ent, a);
@@ -759,13 +759,8 @@ static int update_modify_options(struct libmnt_update *upd, struct libmnt_lock *
                if (cur) {
                        if (upd->userspace_only)
                                rc = mnt_fs_set_attributes(cur, mnt_fs_get_attributes(fs));
-                       if (!rc && !upd->userspace_only)
-                               rc = mnt_fs_set_vfs_options(cur, mnt_fs_get_vfs_options(fs));
-                       if (!rc && !upd->userspace_only)
-                               rc = mnt_fs_set_fs_options(cur, mnt_fs_get_fs_options(fs));
                        if (!rc)
-                               rc = mnt_fs_set_user_options(cur,
-                                               mnt_fs_get_user_options(fs));
+                               rc = mnt_fs_set_options(cur, mnt_fs_get_options(fs));
                        if (!rc)
                                rc = update_table(upd, tb);
                }