]> arthur.barton.de Git - netdata.git/blob - src/proc_self_mountinfo.h
Merge pull request #1065 from facetoe/postgres_plugin
[netdata.git] / src / proc_self_mountinfo.h
1 #ifndef NETDATA_PROC_SELF_MOUNTINFO_H
2 #define NETDATA_PROC_SELF_MOUNTINFO_H 1
3
4 #define MOUNTINFO_IS_DUMMY      0x00000001
5 #define MOUNTINFO_IS_REMOTE     0x00000002
6 #define MOUNTINFO_IS_BIND       0x00000004
7 #define MOUNTINFO_IS_SAME_DEV   0x00000008
8 #define MOUNTINFO_NO_STAT       0x00000010
9 #define MOUNTINFO_NO_SIZE       0x00000020
10
11 struct mountinfo {
12     long id;                // mount ID: unique identifier of the mount (may be reused after umount(2)).
13     long parentid;          // parent ID: ID of parent mount (or of self for the top of the mount tree).
14     unsigned long major;    // major:minor: value of st_dev for files on filesystem (see stat(2)).
15     unsigned long minor;
16
17     char *persistent_id;    // a calculated persistent id for the mount point
18     uint32_t persistent_id_hash;
19
20     char *root;             // root: root of the mount within the filesystem.
21     uint32_t root_hash;
22
23     char *mount_point;      // mount point: mount point relative to the process's root.
24     uint32_t mount_point_hash;
25
26     char *mount_options;    // mount options: per-mount options.
27
28     int optional_fields_count;
29 /*
30     char ***optional_fields; // optional fields: zero or more fields of the form "tag[:value]".
31 */
32     char *filesystem;       // filesystem type: name of filesystem in the form "type[.subtype]".
33     uint32_t filesystem_hash;
34
35     char *mount_source;     // mount source: filesystem-specific information or "none".
36     uint32_t mount_source_hash;
37
38     char *super_options;    // super options: per-superblock options.
39
40     uint32_t flags;
41
42     dev_t st_dev;           // id of device as given by stat()
43
44     struct mountinfo *next;
45 };
46
47 extern struct mountinfo *mountinfo_find(struct mountinfo *root, unsigned long major, unsigned long minor);
48 extern struct mountinfo *mountinfo_find_by_filesystem_mount_source(struct mountinfo *root, const char *filesystem, const char *mount_source);
49 extern struct mountinfo *mountinfo_find_by_filesystem_super_option(struct mountinfo *root, const char *filesystem, const char *super_options);
50
51 extern void mountinfo_free(struct mountinfo *mi);
52 extern struct mountinfo *mountinfo_read();
53
54 #endif /* NETDATA_PROC_SELF_MOUNTINFO_H */