fs->flags |= MNT_FS_PSEUDO;
else if (mnt_fstype_is_netfs(fs->fstype))
fs->flags |= MNT_FS_NET;
+ else if (!strcmp(fs->fstype, "swap"))
+ fs->flags |= MNT_FS_SWAP;
return 0;
}
if (!rc && v)
rc = mnt_optstr_prepend_option(&fs->vfs_optstr, v, NULL);
if (!rc && f)
- rc = mnt_optstr_prepend_option(&fs->fs_optstr, f, NULL);
+ rc = mnt_optstr_prepend_option(&fs->fs_optstr, f, NULL);
return rc;
}
fprintf(file, "target: %s\n", mnt_fs_get_target(fs));
fprintf(file, "fstype: %s\n", mnt_fs_get_fstype(fs));
fprintf(file, "optstr: %s\n", mnt_fs_get_optstr(fs));
- fprintf(file, "freq: %d\n", mnt_fs_get_freq(fs));
- fprintf(file, "pass: %d\n", mnt_fs_get_passno(fs));
- fprintf(file, "id: %d\n", mnt_fs_get_id(fs));
- fprintf(file, "parent: %d\n", mnt_fs_get_parent_id(fs));
- fprintf(file, "devno: %d:%d\n", major(mnt_fs_get_devno(fs)),
- minor(mnt_fs_get_devno(fs)));
+ if (mnt_fs_get_freq(fs))
+ fprintf(file, "freq: %d\n", mnt_fs_get_freq(fs));
+ if (mnt_fs_get_passno(fs))
+ fprintf(file, "pass: %d\n", mnt_fs_get_passno(fs));
+ if (mnt_fs_get_id(fs))
+ fprintf(file, "id: %d\n", mnt_fs_get_id(fs));
+ if (mnt_fs_get_parent_id(fs))
+ fprintf(file, "parent: %d\n", mnt_fs_get_parent_id(fs));
+ if (mnt_fs_get_devno(fs))
+ fprintf(file, "devno: %d:%d\n", major(mnt_fs_get_devno(fs)),
+ minor(mnt_fs_get_devno(fs)));
return 0;
}
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;
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);
s = skip_spaces(buf);
} while (*s == '\0' || *s == '#');
- DBG(TAB, mnt_debug_h(tb, "%s:%d: %s", filename, *nlines, s));
+ /*DBG(TAB, mnt_debug_h(tb, "%s:%d: %s", filename, *nlines, s));*/
if (!tb->fmt)
tb->fmt = detect_fmt(s);
if (!fs->optstr)
return -ENOMEM;
}
-
+/*
DBG(TAB, mnt_debug_h(tb, "%s:%d: SOURCE:%s, MNTPOINT:%s, TYPE:%s, "
"OPTS:%s, FREQ:%d, PASSNO:%d",
filename, *nlines,
fs->source, fs->target, fs->fstype,
fs->optstr, fs->freq, fs->passno));
-
+*/
return 0;
err:
DBG(TAB, mnt_debug_h(tb, "%s:%d: parse error", tb, filename, *nlines));