diff options
author | Ondrej Oprala | 2013-01-10 12:35:08 +0100 |
---|---|---|
committer | Karel Zak | 2013-01-10 14:52:24 +0100 |
commit | e47a19312ff91de3c4ead99714b8bfa06139809e (patch) | |
tree | 10af2946745dab0416cc97e74c5c4ce0c2b8bf90 /libmount/src/fs.c | |
parent | libmount: fix regression test helper (diff) | |
download | kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.gz kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.xz kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.zip |
libmount: read optional mountinfo fields
[kzak@redhat.com: - rename struct member and functions from
"propagation" to "optional fields"
- split the original patch
- fix parser]
Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/fs.c')
-rw-r--r-- | libmount/src/fs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libmount/src/fs.c b/libmount/src/fs.c index d94476870..5c1a1074a 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -691,6 +691,18 @@ const char *mnt_fs_get_options(struct libmnt_fs *fs) 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: @@ -1394,6 +1406,8 @@ int mnt_fs_print_debug(struct libmnt_fs *fs, FILE *file) 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)); |