mnt_fs_get_fstype
mnt_fs_get_id
mnt_fs_get_option
+mnt_fs_get_optional_fields
mnt_fs_get_options
mnt_fs_get_parent_id
mnt_fs_get_passno
return fs ? fs->optstr : NULL;
}
+/**
+ * mnt_fs_get_optional_fields
+ * @fs: mountinfo entry pointer
+ *
+ * Returns: pointer to string with mountinfo optional fields
+ * or NULL in case of error.
+ */
+const char *mnt_fs_get_optional_fields(struct libmnt_fs *fs)
+{
+ assert(fs);
+ return fs ? fs->opt_fields : NULL;
+}
/**
* mnt_fs_set_options:
fprintf(file, "FS-opstr: %s\n", mnt_fs_get_fs_options(fs));
if (mnt_fs_get_user_options(fs))
fprintf(file, "user-optstr: %s\n", mnt_fs_get_user_options(fs));
+ if (mnt_fs_get_optional_fields(fs))
+ fprintf(file, "optional-fields: '%s'\n", mnt_fs_get_optional_fields(fs));
if (mnt_fs_get_attributes(fs))
fprintf(file, "attributes: %s\n", mnt_fs_get_attributes(fs));
extern const char *mnt_fs_get_options(struct libmnt_fs *fs)
__ul_attribute__((nonnull))
__ul_attribute__((warn_unused_result));
+extern const char *mnt_fs_get_optional_fields(struct libmnt_fs *fs)
+ __ul_attribute__((nonnull))
+ __ul_attribute__((warn_unused_result));
extern int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr);
extern int mnt_fs_append_options(struct libmnt_fs *fs, const char *optstr);
extern int mnt_fs_prepend_options(struct libmnt_fs *fs, const char *optstr);
mnt_table_find_devno;
mnt_table_parse_swaps;
} MOUNT_2.21;
+
+MOUNT_2.23 {
+global:
+ mnt_fs_get_optional_fields;
+} MOUNT_2.22;
char *optstr; /* fstab[4], merged options */
char *vfs_optstr; /* mountinfo[6]: fs-independent (VFS) options */
+ char *opt_fields; /* mountinfo[7]: optional fields */
char *fs_optstr; /* mountinfo[11]: fs-dependent options */
char *user_optstr; /* userspace mount options */
char *attrs; /* mount attributes */
DBG(TAB, mnt_debug("mountinfo parse error: not found separator"));
return -EINVAL;
}
+ if (p > s + 1)
+ fs->opt_fields = strndup(s + 1, p - s - 1);
s = p + 3;
rc += sscanf(s, UL_SCNsA" " /* (8) FS type */