summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon-common.h
diff options
context:
space:
mode:
authorKarel Zak2012-04-18 11:21:12 +0200
committerKarel Zak2012-04-18 11:21:12 +0200
commit0b0c231f64d02e6822b62d38705573de6c038b2b (patch)
treec9dcda12f77ff20d4747b575551c78c94d3d30f8 /sys-utils/swapon-common.h
parentswapon: use libmount for fstab parsing (for swapon --all) (diff)
downloadkernel-qcow2-util-linux-0b0c231f64d02e6822b62d38705573de6c038b2b.tar.gz
kernel-qcow2-util-linux-0b0c231f64d02e6822b62d38705573de6c038b2b.tar.xz
kernel-qcow2-util-linux-0b0c231f64d02e6822b62d38705573de6c038b2b.zip
swapon: move generic code to swapon-common.c
This will allow to use separate binary for swapon and swapoff. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/swapon-common.h')
-rw-r--r--sys-utils/swapon-common.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys-utils/swapon-common.h b/sys-utils/swapon-common.h
new file mode 100644
index 000000000..53ba15e0e
--- /dev/null
+++ b/sys-utils/swapon-common.h
@@ -0,0 +1,26 @@
+#ifndef UTIL_LINUX_SWAPON_COMMON_H
+#define UTIL_LINUX_SWAPON_COMMON_H
+
+#include <libmount.h>
+
+extern struct libmnt_cache *mntcache;
+
+extern struct libmnt_table *get_fstab(void);
+extern struct libmnt_table *get_swaps(void);
+extern void free_tables(void);
+
+extern int match_swap(struct libmnt_fs *fs, void *data);
+extern int is_active_swap(const char *filename);
+
+extern int cannot_find(const char *special);
+
+extern void add_label(const char *label);
+extern const char *get_label(size_t i);
+extern size_t numof_labels(void);
+
+extern void add_uuid(const char *uuid);
+extern const char *get_uuid(size_t i);
+extern size_t numof_uuids(void);
+
+
+#endif /* UTIL_LINUX_SWAPON_COMMON_H */