Refresh linux-have-libdiskmgt

This commit is contained in:
Brian Behlendorf 2008-12-05 10:26:25 -08:00
parent 9baaa468ac
commit 56ed73d6e0
3 changed files with 11 additions and 18 deletions

View File

@ -1,3 +1 @@
gcc-branch
fix-branch
feature-branch
zfs-branch

17
.topmsg
View File

@ -1,19 +1,6 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
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,
README, and GIT files.
Use libdiskmgt if HAVE_LIBDISKMGT defined
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

View File

@ -111,6 +111,7 @@ vdev_error(const char *fmt, ...)
va_end(ap);
}
#ifdef HAVE_LIBDISKMGT
static void
libdiskmgt_error(int error)
{
@ -272,6 +273,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
@ -287,6 +289,7 @@ check_file(const char *file, boolean_t force, boolean_t isspare)
pool_state_t state;
boolean_t inuse;
#ifdef HAVE_DM_INUSE_SWAP
if (dm_inuse_swap(file, &err)) {
if (err)
libdiskmgt_error(err);
@ -295,6 +298,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 +1065,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);
}