diff options
author | Karel Zak | 2010-12-18 01:08:25 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:47 +0100 |
commit | 2915bdc0db7b6931c35e235879d59b6c61b4b1bc (patch) | |
tree | fe72436518b23336af7a06416749209781706396 /shlibs/mount/src/context.c | |
parent | libmount: cleanup MS_RDONLY usageand mnt_update_* symbols (diff) | |
download | kernel-qcow2-util-linux-2915bdc0db7b6931c35e235879d59b6c61b4b1bc.tar.gz kernel-qcow2-util-linux-2915bdc0db7b6931c35e235879d59b6c61b4b1bc.tar.xz kernel-qcow2-util-linux-2915bdc0db7b6931c35e235879d59b6c61b4b1bc.zip |
libmount: clean mnt_update_* target usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context.c')
-rw-r--r-- | shlibs/mount/src/context.c | 19 |
1 files changed, 11 insertions, 8 deletions
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; } |