mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
OpenZFS restructuring - libspl
Factor Linux specific pieces out of libspl. Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9336
This commit is contained in:
committed by
Brian Behlendorf
parent
6360e2779e
commit
d31277abb1
@@ -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 = \
|
||||
|
||||
+2
-18
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user