free(fs->source);
free(fs->tagname);
free(fs->tagval);
- free(fs->mntroot);
+ free(fs->root);
free(fs->target);
free(fs->fstype);
free(fs->optstr);
return 0;
}
+/**
+ * mnt_fs_get_root:
+ * @fs: /proc/self/mountinfo entry
+ *
+ * Returns: root of the mount within the filesystem or NULL
+ */
+const char *mnt_fs_get_root(mnt_fs *fs)
+{
+ assert(fs);
+ return fs ? fs->root : NULL;
+}
+
/**
* mnt_fs_get_id:
* @fs: /proc/self/mountinfo entry
/**
* mnt_fs_get_devno:
- * @fs: /proc/self/mountinfo
+ * @fs: /proc/self/mountinfo entry
*
* Returns: value of st_dev for files on filesystem or 0 in case of error.
*/
#include <stdio.h>
-
#define LIBMOUNT_VERSION "@LIBMOUNT_VERSION@"
/**
extern int mnt_fs_set_freq(mnt_fs *ent, int freq);
extern int mnt_fs_get_passno(mnt_fs *ent);
extern int mnt_fs_set_passno(mnt_fs *ent, int passno);
+extern const char *mnt_fs_get_root(mnt_fs *fs);
extern int mnt_fs_get_id(mnt_fs *fs);
extern int mnt_fs_get_parent_id(mnt_fs *fs);
extern dev_t mnt_fs_get_devno(mnt_fs *fs);
local:
*;
};
+
+
+MOUNT_2.19 {
+global:
+ mnt_fs_get_root;
+} MOUNT_2.18;
char *tagname; /* fstab[1]: tag name - "LABEL", "UUID", ..*/
char *tagval; /* tag value */
- char *mntroot; /* mountinfo[4]: root of the mount within the FS */
+ char *root; /* mountinfo[4]: root of the mount within the FS */
char *target; /* mountinfo[5], fstab[2]: mountpoint */
char *fstype; /* mountinfo[9], fstab[3]: filesystem type */
next_word_skip(&s);
/* MOUNTROOT */
- fs->mntroot = next_word(&s);
- if (!fs->mntroot)
+ fs->root = next_word(&s);
+ if (!fs->root)
return 1;
/* TARGET (mountpoit) */