diff options
author | Karel Zak | 2013-08-21 10:01:23 +0200 |
---|---|---|
committer | Karel Zak | 2013-08-21 10:01:23 +0200 |
commit | 32953aebdd355b00fed519a06b015f63e6e3af1e (patch) | |
tree | e1f406baac065ea35d4cd94fbc70254927b85c6a /libmount/src/context.c | |
parent | pylibmount: remove unnecessary code (diff) | |
download | kernel-qcow2-util-linux-32953aebdd355b00fed519a06b015f63e6e3af1e.tar.gz kernel-qcow2-util-linux-32953aebdd355b00fed519a06b015f63e6e3af1e.tar.xz kernel-qcow2-util-linux-32953aebdd355b00fed519a06b015f63e6e3af1e.zip |
libmount: add function for context userdata
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r-- | libmount/src/context.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index e7fc3981a..12f22fc92 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -677,6 +677,42 @@ struct libmnt_fs *mnt_context_get_fs(struct libmnt_context *cxt) } /** + * mnt_context_get_fs_userdata: + * @cxt: mount context + * + * Returns: pointer to userdata or NULL. + */ +void *mnt_context_get_fs_userdata(struct libmnt_context *cxt) +{ + assert(cxt); + return cxt->fs ? mnt_fs_get_userdata(cxt->fs) : NULL; +} + +/** + * mnt_context_get_fstab_userdata: + * @cxt: mount context + * + * Returns: pointer to userdata or NULL. + */ +void *mnt_context_get_fstab_userdata(struct libmnt_context *cxt) +{ + assert(cxt); + return cxt->fstab ? mnt_table_get_userdata(cxt->fstab) : NULL; +} + +/** + * mnt_context_get_mtab_userdata: + * @cxt: mount context + * + * Returns: pointer to userdata or NULL. + */ +void *mnt_context_get_mtab_userdata(struct libmnt_context *cxt) +{ + assert(cxt); + return cxt->mtab ? mnt_table_get_userdata(cxt->mtab) : NULL; +} + +/** * mnt_context_set_source: * @cxt: mount context * @source: mount source (device, directory, UUID, LABEL, ...) |