From dc4dbbf188be91da4b13b29e04ae94f2f831e4ab Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 13 Jan 2012 16:27:50 +0100 Subject: libmount: allow to toggle ro/rw and mount again Signed-off-by: Karel Zak --- libmount/src/context.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libmount/src/context.c') 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; } -- cgit v1.2.3-55-g7522