summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/tab.c
diff options
context:
space:
mode:
authorKarel Zak2010-09-15 16:31:38 +0200
committerKarel Zak2011-01-03 12:28:42 +0100
commit9dd75aa6f25d88e483616b8df2d534408776532f (patch)
treea980021cc0cb19561a39f62383d01ddb7e94ad5a /shlibs/mount/src/tab.c
parentlibmount: cleanup debug flags (diff)
downloadkernel-qcow2-util-linux-9dd75aa6f25d88e483616b8df2d534408776532f.tar.gz
kernel-qcow2-util-linux-9dd75aa6f25d88e483616b8df2d534408776532f.tar.xz
kernel-qcow2-util-linux-9dd75aa6f25d88e483616b8df2d534408776532f.zip
libmount: add MNT_FS_SWAP flag
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/tab.c')
-rw-r--r--shlibs/mount/src/tab.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c
index d5bde746a..39f7814e4 100644
--- a/shlibs/mount/src/tab.c
+++ b/shlibs/mount/src/tab.c
@@ -449,8 +449,11 @@ mnt_fs *mnt_tab_find_target(mnt_tab *tb, const char *path, int direction)
mnt_reset_iter(&itr, direction);
while(mnt_tab_next_fs(tb, &itr, &fs) == 0) {
char *p;
- if (!fs->target)
+
+ if (!fs->target || !(fs->flags & MNT_FS_SWAP) ||
+ (*fs->target == '/' && *(fs->target + 1) == '\0'))
continue;
+
p = mnt_resolve_path(fs->target, tb->cache);
if (strcmp(cn, p) == 0)
return fs;
@@ -546,6 +549,8 @@ mnt_fs *mnt_tab_find_srcpath(mnt_tab *tb, const char *path, int direction)
if (ntags <= mnt_tab_get_nents(tb)) {
mnt_reset_iter(&itr, direction);
while(mnt_tab_next_fs(tb, &itr, &fs) == 0) {
+ if (fs->flags & (MNT_FS_NET | MNT_FS_PSEUDO))
+ continue;
p = mnt_fs_get_srcpath(fs);
if (p)
p = mnt_resolve_path(p, tb->cache);