From 9dd75aa6f25d88e483616b8df2d534408776532f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 Sep 2010 16:31:38 +0200 Subject: libmount: add MNT_FS_SWAP flag Signed-off-by: Karel Zak --- shlibs/mount/src/fs.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'shlibs/mount/src/fs.c') diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c index fad5da890..adf99ca4d 100644 --- a/shlibs/mount/src/fs.c +++ b/shlibs/mount/src/fs.c @@ -348,6 +348,8 @@ int __mnt_fs_set_fstype(mnt_fs *fs, char *fstype) 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; } @@ -508,7 +510,7 @@ int mnt_fs_prepend_optstr(mnt_fs *fs, const char *optstr) 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; } @@ -844,11 +846,16 @@ int mnt_fs_print_debug(mnt_fs *fs, FILE *file) 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; } -- cgit v1.2.3-55-g7522