diff options
author | Karel Zak | 2012-01-02 15:00:27 +0100 |
---|---|---|
committer | Karel Zak | 2012-01-02 15:00:27 +0100 |
commit | c70d9d768bbe291ad29f29200340d1f4d8bbf30f (patch) | |
tree | 0878a5b06223146a9bbe6a48109cf348df75218d /libmount/src/fs.c | |
parent | mount: don't canonicalize the source of a pseudofs (diff) | |
download | kernel-qcow2-util-linux-c70d9d768bbe291ad29f29200340d1f4d8bbf30f.tar.gz kernel-qcow2-util-linux-c70d9d768bbe291ad29f29200340d1f4d8bbf30f.tar.xz kernel-qcow2-util-linux-c70d9d768bbe291ad29f29200340d1f4d8bbf30f.zip |
libmount: consolidate MNT_FS_* code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/fs.c')
-rw-r--r-- | libmount/src/fs.c | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c index 90f484bec..43faa0511 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -437,20 +437,11 @@ int mnt_fs_set_target(struct libmnt_fs *fs, const char *target) return 0; } -int __mnt_fs_get_flags(struct libmnt_fs *fs) +static int mnt_fs_get_flags(struct libmnt_fs *fs) { return fs ? fs->flags : 0; } -int __mnt_fs_set_flags(struct libmnt_fs *fs, int flags) -{ - if (fs) { - fs->flags = flags; - return 0; - } - return -EINVAL; -} - /** * mnt_fs_is_kernel: * @fs: filesystem @@ -459,7 +450,40 @@ int __mnt_fs_set_flags(struct libmnt_fs *fs, int flags) */ int mnt_fs_is_kernel(struct libmnt_fs *fs) { - return __mnt_fs_get_flags(fs) & MNT_FS_KERNEL; + return mnt_fs_get_flags(fs) & MNT_FS_KERNEL; +} + +/** + * mnt_fs_is_swaparea: + * @fs: filesystem + * + * Returns: 1 if the filesystem uses "swap" as a type + */ +int mnt_fs_is_swaparea(struct libmnt_fs *fs) +{ + return mnt_fs_get_flags(fs) & MNT_FS_SWAP; +} + +/** + * mnt_fs_is_pseudofs: + * @fs: filesystem + * + * Returns: 1 if the filesystem is a pseudo fs type (proc, cgroups) + */ +int mnt_fs_is_pseudo(struct libmnt_fs *fs) +{ + return mnt_fs_get_flags(fs) & MNT_FS_PSEUDO; +} + +/** + * mnt_fs_is_netfs: + * @fs: filesystem + * + * Returns: 1 if the filesystem is a network filesystem + */ +int mnt_fs_is_netfs(struct libmnt_fs *fs) +{ + return mnt_fs_get_flags(fs) & MNT_FS_NET; } /** |