summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/mountP.h
diff options
context:
space:
mode:
authorKarel Zak2010-01-13 22:08:16 +0100
committerKarel Zak2010-06-03 15:20:11 +0200
commit6bd8b7a79dffb532ae8639e563f75005a10bc41d (patch)
tree470fe4db5d45f28e2f5c49db4388d315f39e5b61 /shlibs/mount/src/mountP.h
parentlibmount: rename mnt_optls_iterate_options() (diff)
downloadkernel-qcow2-util-linux-6bd8b7a79dffb532ae8639e563f75005a10bc41d.tar.gz
kernel-qcow2-util-linux-6bd8b7a79dffb532ae8639e563f75005a10bc41d.tar.xz
kernel-qcow2-util-linux-6bd8b7a79dffb532ae8639e563f75005a10bc41d.zip
libmount: add fstab/mtab/mountinfo parsing routines
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/mountP.h')
-rw-r--r--shlibs/mount/src/mountP.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h
index b6eb8cd34..f08f435a4 100644
--- a/shlibs/mount/src/mountP.h
+++ b/shlibs/mount/src/mountP.h
@@ -35,6 +35,7 @@
#define DEBUG_CACHE (1 << 2)
#define DEBUG_OPTIONS (1 << 3)
#define DEBUG_LOCKS (1 << 4)
+#define DEBUG_TAB (1 << 5)
#define DEBUG_ALL 0xFFFF
#ifdef CONFIG_LIBMOUNT_DEBUG
@@ -162,6 +163,31 @@ struct _mnt_fs {
#define MNT_FS_PSEUDO (1 << 2) /* pseudo filesystem */
#define MNT_FS_NET (1 << 3) /* network filesystem */
+/*
+ * File format
+ */
+enum {
+ MNT_FMT_FSTAB = 1, /* /etc/{fs,m}tab */
+ MNT_FMT_MOUNTINFO /* /proc/#/mountinfo */
+};
+
+/*
+ * mtab/fstab/mountinfo file
+ */
+struct _mnt_tab {
+ char *filename; /* file name or NULL */
+ int fmt; /* MNT_FMT_* file format */
+
+ int nlines; /* number of lines in the file (include commentrys) */
+ int nents; /* number of valid entries */
+ int nerrs; /* number of broken entries (parse errors) */
+
+ mnt_cache *cache; /* canonicalized paths/tags cache */
+
+ struct list_head ents; /* list of entries (mentry) */
+};
+
+
/* optmap.c */
extern const struct mnt_optmap *mnt_optmap_get_entry(struct mnt_optmap const **maps,
int nmaps, const char *name,
@@ -189,4 +215,6 @@ extern int mnt_optent_assign_map(mnt_optent *op,
extern int __mnt_fs_set_source(mnt_fs *fs, char *source);
extern int __mnt_fs_set_fstype(mnt_fs *fs, char *fstype);
+
+
#endif /* _LIBMOUNT_PRIVATE_H */