diff options
author | Karel Zak | 2018-12-10 11:39:08 +0100 |
---|---|---|
committer | Karel Zak | 2018-12-10 11:39:08 +0100 |
commit | 1dae161c839ead8a642b74f432e0f82bb5f5fdd2 (patch) | |
tree | a6fd41e8f992e106cdf94f34c2f4bf0c7905a420 /libmount | |
parent | lsblk: add --merge (diff) | |
download | kernel-qcow2-util-linux-1dae161c839ead8a642b74f432e0f82bb5f5fdd2.tar.gz kernel-qcow2-util-linux-1dae161c839ead8a642b74f432e0f82bb5f5fdd2.tar.xz kernel-qcow2-util-linux-1dae161c839ead8a642b74f432e0f82bb5f5fdd2.zip |
libmount: export mnt_guess_system_root() by API
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount')
-rw-r--r-- | libmount/docs/libmount-sections.txt | 1 | ||||
-rw-r--r-- | libmount/src/libmount.h.in | 2 | ||||
-rw-r--r-- | libmount/src/libmount.sym | 4 | ||||
-rw-r--r-- | libmount/src/mountP.h | 1 | ||||
-rw-r--r-- | libmount/src/utils.c | 7 |
5 files changed, 13 insertions, 2 deletions
diff --git a/libmount/docs/libmount-sections.txt b/libmount/docs/libmount-sections.txt index 811726bb2..a046fb387 100644 --- a/libmount/docs/libmount-sections.txt +++ b/libmount/docs/libmount-sections.txt @@ -398,6 +398,7 @@ mnt_get_fstab_path mnt_get_mountpoint mnt_get_mtab_path mnt_get_swaps_path +mnt_guess_system_root mnt_has_regular_mtab mnt_mangle mnt_match_fstype diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in index 63ba3225f..1ce9995ec 100644 --- a/libmount/src/libmount.h.in +++ b/libmount/src/libmount.h.in @@ -326,6 +326,8 @@ extern const char *mnt_get_mtab_path(void); extern int mnt_has_regular_mtab(const char **mtab, int *writable); extern char *mnt_get_mountpoint(const char *path) __ul_attribute__((warn_unused_result)); +extern int mnt_guess_system_root(dev_t devno, struct libmnt_cache *cache, char **path) + __ul_attribute__((nonnull(3))); /* cache.c */ extern struct libmnt_cache *mnt_new_cache(void) diff --git a/libmount/src/libmount.sym b/libmount/src/libmount.sym index ad7bd4786..5145c876d 100644 --- a/libmount/src/libmount.sym +++ b/libmount/src/libmount.sym @@ -341,3 +341,7 @@ MOUNT_2.33 { mnt_context_switch_origin_ns; mnt_context_switch_target_ns; } MOUNT_2.30; + +MOUNT_2.34 { + mnt_guess_system_root; +} MOUNT_2.33; diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 8f4fba7af..795ea69dc 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -120,7 +120,6 @@ extern int mnt_get_filesystems(char ***filesystems, const char *pattern); extern void mnt_free_filesystems(char **filesystems); extern char *mnt_get_kernel_cmdline_option(const char *name); -extern int mnt_guess_system_root(dev_t devno, struct libmnt_cache *cache, char **path); extern int mnt_stat_mountpoint(const char *target, struct stat *st); /* tab.c */ diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 034d3436f..4f4d10bf9 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -1037,7 +1037,12 @@ char *mnt_get_kernel_cmdline_option(const char *name) return res; } -/* +/** + * mnt_guess_system_root: + * @devno: device number or zero + * @cache: paths cache or NULL + * @path: returns allocated path + * * Converts @devno to the real device name if devno major number is greater * than zero, otherwise use root= kernel cmdline option to get device name. * |