From 2915bdc0db7b6931c35e235879d59b6c61b4b1bc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Sat, 18 Dec 2010 01:08:25 +0100 Subject: libmount: clean mnt_update_* target usage Signed-off-by: Karel Zak --- shlibs/mount/src/context.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'shlibs/mount/src/context.c') diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c index abe0dc9d0..8fbad4a83 100644 --- a/shlibs/mount/src/context.c +++ b/shlibs/mount/src/context.c @@ -850,8 +850,10 @@ int mnt_context_prepare_srcpath(mnt_context *cxt) src = mnt_fs_get_source(cxt->fs); - /* ignore filesystems without a real source */ - if (!src || (cxt->fs->flags & (MNT_FS_PSEUDO | MNT_FS_NET))) + /* ignore filesystems without a real source or MS_PROPAGATION stuff */ + if (!src || + (cxt->fs->flags & (MNT_FS_PSEUDO | MNT_FS_NET)) || + (cxt->mountflags & (MS_BIND | MS_MOVE | MS_PROPAGATION))) return 0; DBG(CXT, mnt_debug_h(cxt, "srcpath '%s'", src)); @@ -893,9 +895,7 @@ int mnt_context_prepare_srcpath(mnt_context *cxt) /* * Initialize loop device */ - if (is_loop(cxt) && - !(cxt->mountflags & (MS_BIND | MS_MOVE | - MS_PROPAGATION | MS_REMOUNT))) { + if (is_loop(cxt)) { ; /* TODO */ } @@ -1102,9 +1102,12 @@ int mnt_context_prepare_update(mnt_context *cxt) !cxt->mtab_writable); } - rc = mnt_update_set_fs(cxt->update, cxt->mountflags, - mnt_fs_get_target(cxt->fs), - cxt->action == MNT_ACT_UMOUNT ? NULL : cxt->fs); + if (cxt->action == MNT_ACT_UMOUNT) + rc = mnt_update_set_fs(cxt->update, cxt->mountflags, + mnt_fs_get_target(cxt->fs), NULL); + else + rc = mnt_update_set_fs(cxt->update, cxt->mountflags, + NULL, cxt->fs); return rc < 0 ? rc : 0; } -- cgit v1.2.3-55-g7522