diff options
author | asomers <asomers@FreeBSD.org> | 2017-11-28 16:52:38 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2017-11-28 16:52:38 +0000 |
commit | b7b345810f6a98fe614c95438c4cfe57d23b8a3d (patch) | |
tree | 94861a9ecb514bb7b864abe3c7eea0a1be48e591 /lib | |
parent | 1f0fdba2a067a1d3ecb412af272950be6662c53d (diff) | |
download | FreeBSD-src-b7b345810f6a98fe614c95438c4cfe57d23b8a3d.zip FreeBSD-src-b7b345810f6a98fe614c95438c4cfe57d23b8a3d.tar.gz |
MFC r325011, r325016
r325011:
zfsd should be able to online an L2ARC that disappears and returns
Previously, this didn't work because L2ARC devices' labels don't contain
pool GUIDs. Modify zfsd so that the pool GUID won't be required:
lib/libdevdctl/guid.h
Change INVALID_GUID from a uint64_t constant to a function that
returns an invalid Guid object. Remove the void constructor.
Nothing uses it, and it violates RAII.
cddl/usr.sbin/zfsd/case_file.h
cddl/usr.sbin/zfsd/case_file.cc
Allow CaseFile::Find to match a CaseFile based on Vdev GUID alone.
In CaseFile::ReEvaluate, attempt to online devices even if the newly
arrived device has no pool GUID.
cddl/usr.sbin/zfsd/vdev_iterator.cc
Iterate through a pool's cache devices as well as its regular
devices.
Reported by: avg
Reviewed by: avg
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12791
r325016:
Partially revert r325011: restore Guid's default constructor
Reported by: ohartmann
X-MFC-With: 325011
Sponsored by: Spectra Logic Corp
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libdevdctl/guid.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libdevdctl/guid.h b/lib/libdevdctl/guid.h index ede414b..02ea6f2 100644 --- a/lib/libdevdctl/guid.h +++ b/lib/libdevdctl/guid.h @@ -62,9 +62,13 @@ class Guid { public: /* Constructors */ + /* Default constructor: an Invalid guid */ Guid(); + /* Construct a guid from a provided integer */ Guid(uint64_t guid); + /* Construct a guid from a string in base 8, 10, or 16 */ Guid(const std::string &guid); + static Guid InvalidGuid(); /* Assignment */ Guid& operator=(const Guid& rhs); @@ -80,8 +84,9 @@ public: operator uint64_t() const; operator bool() const; - static const uint64_t INVALID_GUID = 0; protected: + static const uint64_t INVALID_GUID = 0; + /* The integer value of the GUID. */ uint64_t m_GUID; }; @@ -99,6 +104,12 @@ Guid::Guid(uint64_t guid) { } +inline Guid +Guid::InvalidGuid() +{ + return (Guid(INVALID_GUID)); +} + inline Guid& Guid::operator=(const Guid &rhs) { |