summaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak2015-03-10 13:35:56 +0100
committerKarel Zak2015-03-10 13:49:57 +0100
commitcc06a01ec551ed2bcd397a5097165b4434179b34 (patch)
treebbdfb43dea554a0c315aa647718ee946c7813f0a /libmount/src/utils.c
parentfindmnt: don't rely on st_dev for --target (diff)
downloadkernel-qcow2-util-linux-cc06a01ec551ed2bcd397a5097165b4434179b34.tar.gz
kernel-qcow2-util-linux-cc06a01ec551ed2bcd397a5097165b4434179b34.tar.xz
kernel-qcow2-util-linux-cc06a01ec551ed2bcd397a5097165b4434179b34.zip
libmount: cleanup fs root detection code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 6f4d1a19f..bc43a85cf 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -1010,28 +1010,6 @@ err:
return NULL;
}
-char *mnt_get_fs_root(const char *path, const char *mnt)
-{
- char *m = (char *) mnt, *res;
- const char *p;
- size_t sz;
-
- if (!m)
- m = mnt_get_mountpoint(path);
- if (!m)
- return NULL;
-
- sz = strlen(m);
- p = sz > 1 ? path + sz : path;
-
- if (m != mnt)
- free(m);
-
- res = *p ? strdup(p) : strdup("/");
- DBG(UTILS, ul_debug("%s fs-root is %s", path, res));
- return res;
-}
-
/*
* Search for @name kernel command parametr.
*
@@ -1176,17 +1154,6 @@ int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
return 0;
}
-int test_fsroot(struct libmnt_test *ts, int argc, char *argv[])
-{
- char *path = canonicalize_path(argv[1]),
- *mnt = path ? mnt_get_fs_root(path, NULL) : NULL;
-
- printf("%s: %s\n", argv[1], mnt ? : "unknown");
- free(mnt);
- free(path);
- return 0;
-}
-
int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
{
char **filesystems = NULL;
@@ -1277,7 +1244,6 @@ int main(int argc, char *argv[])
{ "--ends-with", test_endswith, "<string> <prefix>" },
{ "--append-string", test_appendstr, "<string> <appendix>" },
{ "--mountpoint", test_mountpoint, "<path>" },
- { "--fs-root", test_fsroot, "<path>" },
{ "--cd-parent", test_chdir, "<path>" },
{ "--kernel-cmdline",test_kernel_cmdline, "<option> | <option>=" },
{ "--mkdir", test_mkdir, "<path>" },