diff --git a/.topdeps b/.topdeps index 607c231780..7f16cbcdd5 100644 --- a/.topdeps +++ b/.topdeps @@ -1,3 +1 @@ -gcc-branch -fix-branch -feature-branch +zfs-branch diff --git a/.topmsg b/.topmsg index 03967cdff5..af2af320e8 100644 --- a/.topmsg +++ b/.topmsg @@ -1,19 +1,6 @@ From: Brian Behlendorf -Subject: [PATCH] zfs branch +Subject: [PATCH] linux have libdiskmgt -Merged result of all changes which are relevant to both Solaris -and Linux builds of the ZFS code. These are changes where there -is a reasonable chance they will be accepted upstream. - -Additionally, since this is effectively the root of the linux -ZFS tree the core linux build system is added here. This -includes autogen.sh, configure.ac, m4 macros, some scripts/*, -and makefiles for all the core ZFS components. Linux-only -features which require tweaks to the build system should appear -on the relevant topic branches. All autotools products which -result from autogen.sh are commited to the linux-configure-branch. - -This branch also contains the META, ChangeLog, AUTHORS, TODO, -and README, files. +Use libdiskmgt if HAVE_LIBDISKMGT defined Signed-off-by: Brian Behlendorf diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 9fa227c102..fa4640abab 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -64,7 +64,9 @@ #include #include #include +#ifdef HAVE_LIBDISKMGT #include +#endif #include #include #include @@ -111,6 +113,7 @@ vdev_error(const char *fmt, ...) va_end(ap); } +#ifdef HAVE_LIBDISKMGT static void libdiskmgt_error(int error) { @@ -272,6 +275,7 @@ check_device(const char *path, boolean_t force, boolean_t isspare) return (check_slice(path, force, B_FALSE, isspare)); } +#endif /* * Check that a file is valid. All we can do in this case is check that it's @@ -283,9 +287,10 @@ check_file(const char *file, boolean_t force, boolean_t isspare) char *name; int fd; int ret = 0; - int err; pool_state_t state; boolean_t inuse; +#ifdef HAVE_DM_INUSE_SWAP + int err; if (dm_inuse_swap(file, &err)) { if (err) @@ -295,6 +300,7 @@ check_file(const char *file, boolean_t force, boolean_t isspare) "Please see swap(1M).\n"), file); return (-1); } +#endif if ((fd = open(file, O_RDONLY)) < 0) return (0); @@ -1061,11 +1067,15 @@ check_in_use(nvlist_t *config, nvlist_t *nv, int force, int isreplacing, return (0); } +#ifdef HAVE_LIBDISKMGT if (strcmp(type, VDEV_TYPE_DISK) == 0) ret = check_device(path, force, isspare); if (strcmp(type, VDEV_TYPE_FILE) == 0) ret = check_file(path, force, isspare); +#else + ret = check_file(path, force, isspare); +#endif return (ret); }