Changeset View
Changeset View
Standalone View
Standalone View
cddl/usr.sbin/zfsd/zfsd_event.cc
Show All 28 Lines | |||||
* | * | ||||
* Authors: Justin T. Gibbs (Spectra Logic Corporation) | * Authors: Justin T. Gibbs (Spectra Logic Corporation) | ||||
*/ | */ | ||||
/** | /** | ||||
* \file zfsd_event.cc | * \file zfsd_event.cc | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
#include <sys/byteorder.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/fs/zfs.h> | #include <sys/fs/zfs.h> | ||||
#include <sys/vdev_impl.h> | #include <sys/vdev_impl.h> | ||||
#include <syslog.h> | #include <syslog.h> | ||||
#include <libzfs.h> | #include <libzfs.h> | ||||
#include <libzutil.h> | |||||
/* | /* | ||||
* Undefine flush, defined by cpufunc.h on sparc64, because it conflicts with | * Undefine flush, defined by cpufunc.h on sparc64, because it conflicts with | ||||
* C++ flush methods | * C++ flush methods | ||||
*/ | */ | ||||
#undef flush | #undef flush | ||||
#include <list> | #include <list> | ||||
#include <map> | #include <map> | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | GeomEvent::ReadLabel(int devFd, bool &inUse, bool °raded) | ||||
if (zpool_in_use(g_zfsHandle, devFd, &poolState, | if (zpool_in_use(g_zfsHandle, devFd, &poolState, | ||||
&poolName, &b_inuse) == 0) { | &poolName, &b_inuse) == 0) { | ||||
nvlist_t *devLabel = NULL; | nvlist_t *devLabel = NULL; | ||||
inUse = b_inuse == B_TRUE; | inUse = b_inuse == B_TRUE; | ||||
if (poolName != NULL) | if (poolName != NULL) | ||||
free(poolName); | free(poolName); | ||||
nlabels = zpool_read_all_labels(devFd, &devLabel); | if (zpool_read_label(devFd, &devLabel, &nlabels) != 0) | ||||
return (NULL); | |||||
/* | /* | ||||
* If we find a disk with fewer than the maximum number of | * If we find a disk with fewer than the maximum number of | ||||
* labels, it might be the whole disk of a partitioned disk | * labels, it might be the whole disk of a partitioned disk | ||||
* where ZFS resides on a partition. In that case, we should do | * where ZFS resides on a partition. In that case, we should do | ||||
* nothing and wait for the partition to appear. Or, the disk | * nothing and wait for the partition to appear. Or, the disk | ||||
* might be damaged. In that case, zfsd should do nothing and | * might be damaged. In that case, zfsd should do nothing and | ||||
* wait for the sysadmin to decide. | * wait for the sysadmin to decide. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines |