diff options
author | Karel Zak | 2012-01-13 16:27:50 +0100 |
---|---|---|
committer | Karel Zak | 2012-01-13 16:27:50 +0100 |
commit | dc4dbbf188be91da4b13b29e04ae94f2f831e4ab (patch) | |
tree | 91713f0d0fc33f5b9ab330b3b77c92996915f01c /libmount/src/context.c | |
parent | libmount: allow to use UUID and LABEL for owner/group mount options in fstab (diff) | |
download | kernel-qcow2-util-linux-dc4dbbf188be91da4b13b29e04ae94f2f831e4ab.tar.gz kernel-qcow2-util-linux-dc4dbbf188be91da4b13b29e04ae94f2f831e4ab.tar.xz kernel-qcow2-util-linux-dc4dbbf188be91da4b13b29e04ae94f2f831e4ab.zip |
libmount: allow to toggle ro/rw and mount again
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r-- | libmount/src/context.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index 594f090f4..571a2496a 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -1001,7 +1001,18 @@ int mnt_context_set_mflags(struct libmnt_context *cxt, unsigned long flags) { if (!cxt) return -EINVAL; + cxt->mountflags = flags; + + if ((cxt->flags & MNT_FL_MOUNTOPTS_FIXED) && cxt->fs) + /* + * the final mount options are already generated, refresh... + */ + return mnt_optstr_apply_flags( + &cxt->fs->vfs_optstr, + cxt->mountflags, + mnt_get_builtin_optmap(MNT_LINUX_MAP)); + return 0; } |