aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-02 10:39:48 -0700
committerBrian Behlendorf <[email protected]>2019-10-02 10:39:48 -0700
commitd31277abb1db51dece836dd47628ca42c07e528c (patch)
treeb2635f2c39d2315d21af445522203dffbae57851 /cmd/zfs
parent6360e2779e47f4bf2233071b427ad522eca9bdd4 (diff)
OpenZFS restructuring - libspl
Factor Linux specific pieces out of libspl. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Sean Eric Fagan <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9336
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/Makefile.am4
-rw-r--r--cmd/zfs/zfs_main.c20
2 files changed, 2 insertions, 22 deletions
diff --git a/cmd/zfs/Makefile.am b/cmd/zfs/Makefile.am
index 8b6ddaa20..49ad6f21f 100644
--- a/cmd/zfs/Makefile.am
+++ b/cmd/zfs/Makefile.am
@@ -1,9 +1,5 @@
include $(top_srcdir)/config/Rules.am
-DEFAULT_INCLUDES += \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/lib/libspl/include
-
sbin_PROGRAMS = zfs
zfs_SOURCES = \
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 62c5bcca4..9597e2790 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -6969,18 +6969,6 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
ino_t path_inode;
- /*
- * Search for the path in /proc/self/mounts. Rather than looking for the
- * specific path, which can be fooled by non-standard paths (i.e. ".."
- * or "//"), we stat() the path and search for the corresponding
- * (major,minor) device pair.
- */
- if (stat64(path, &statbuf) != 0) {
- (void) fprintf(stderr, gettext("cannot %s '%s': %s\n"),
- cmdname, path, strerror(errno));
- return (1);
- }
- path_inode = statbuf.st_ino;
/*
* Search for the given (major,minor) pair in the mount table.
@@ -6990,12 +6978,7 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
if (freopen(MNTTAB, "r", mnttab_file) == NULL)
return (ENOENT);
- while ((ret = getextmntent(mnttab_file, &entry, 0)) == 0) {
- if (entry.mnt_major == major(statbuf.st_dev) &&
- entry.mnt_minor == minor(statbuf.st_dev))
- break;
- }
- if (ret != 0) {
+ if (getextmntent(path, &entry, &statbuf) != 0) {
if (op == OP_SHARE) {
(void) fprintf(stderr, gettext("cannot %s '%s': not "
"currently mounted\n"), cmdname, path);
@@ -7008,6 +6991,7 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
strerror(errno));
return (ret != 0);
}
+ path_inode = statbuf.st_ino;
if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) {
(void) fprintf(stderr, gettext("cannot %s '%s': not a ZFS "