summaryrefslogtreecommitdiffstats
path: root/libmount/src
diff options
context:
space:
mode:
authorDave Reisner2012-04-26 02:30:51 +0200
committerKarel Zak2012-04-26 09:38:02 +0200
commitcd3d6c5bd0d2d4350972dc38d53753b5581c1941 (patch)
tree2a0e72fbb0104fcff39ed0811bb40d957f83384b /libmount/src
parentlib/tt: check for non-printable chars for raw/export format (diff)
downloadkernel-qcow2-util-linux-cd3d6c5bd0d2d4350972dc38d53753b5581c1941.tar.gz
kernel-qcow2-util-linux-cd3d6c5bd0d2d4350972dc38d53753b5581c1941.tar.xz
kernel-qcow2-util-linux-cd3d6c5bd0d2d4350972dc38d53753b5581c1941.zip
libmount: expose mnt_get_mountpoint as external API
Diffstat (limited to 'libmount/src')
-rw-r--r--libmount/src/libmount.h.in1
-rw-r--r--libmount/src/libmount.sym1
-rw-r--r--libmount/src/mountP.h1
-rw-r--r--libmount/src/utils.c9
4 files changed, 11 insertions, 1 deletions
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in
index 5c5edbba6..e11c0c09c 100644
--- a/libmount/src/libmount.h.in
+++ b/libmount/src/libmount.h.in
@@ -146,6 +146,7 @@ extern const char *mnt_get_fstab_path(void);
extern const char *mnt_get_swaps_path(void);
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);
/* cache.c */
extern struct libmnt_cache *mnt_new_cache(void);
diff --git a/libmount/src/libmount.sym b/libmount/src/libmount.sym
index ca7a305cc..d4d5b84bf 100644
--- a/libmount/src/libmount.sym
+++ b/libmount/src/libmount.sym
@@ -237,6 +237,7 @@ global:
mnt_context_is_nohelpers;
mnt_table_find_devno;
mnt_table_parse_swaps;
+ mnt_get_mountpoint;
mnt_get_swaps_path;
mnt_fs_get_swaptype;
mnt_fs_get_size;
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
index ee5e94fb2..c7d378eeb 100644
--- a/libmount/src/mountP.h
+++ b/libmount/src/mountP.h
@@ -139,7 +139,6 @@ extern int mnt_get_uid(const char *username, uid_t *uid);
extern int mnt_get_gid(const char *groupname, gid_t *gid);
extern int mnt_in_group(gid_t gid);
-extern char *mnt_get_mountpoint(const char *path);
extern char *mnt_get_fs_root(const char *path, const char *mountpoint);
extern int mnt_open_uniq_filename(const char *filename, char **name);
extern int mnt_has_regular_utab(const char **utab, int *writable);
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index e740d83d0..b824edccf 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -785,6 +785,15 @@ int mnt_open_uniq_filename(const char *filename, char **name)
return fd < 0 ? -errno : fd;
}
+/**
+ * mnt_get_mountpoint:
+ * @path: pathname
+ *
+ * This function finds the mountpoint that a given path resides in. @path
+ * should be canonicalized. The returned pointer should be freed by the caller.
+ *
+ * Returns: target of mounted device or NULL on error
+ */
char *mnt_get_mountpoint(const char *path)
{
char *mnt = strdup(path);