aboutsummaryrefslogtreecommitdiff
path: root/lib/libdevdctl
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2017-10-26 15:28:18 +0000
committerAlan Somers <asomers@FreeBSD.org>2017-10-26 15:28:18 +0000
commit12a88a3d637e7e7a3726e8dedbcf82cb96cea529 (patch)
tree60d86f54828d5cac293e9367b68fcd7eb77806cf /lib/libdevdctl
parent79b67c8d4a6c421a42edfd087b3ee84856e7e118 (diff)
downloadsrc-12a88a3d637e7e7a3726e8dedbcf82cb96cea529.tar.gz
src-12a88a3d637e7e7a3726e8dedbcf82cb96cea529.zip
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 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12791
Notes
Notes: svn path=/head/; revision=325011
Diffstat (limited to 'lib/libdevdctl')
-rw-r--r--lib/libdevdctl/guid.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libdevdctl/guid.h b/lib/libdevdctl/guid.h
index ede414bec649..e40d3f983aab 100644
--- a/lib/libdevdctl/guid.h
+++ b/lib/libdevdctl/guid.h
@@ -62,9 +62,9 @@ class Guid
{
public:
/* Constructors */
- Guid();
Guid(uint64_t guid);
Guid(const std::string &guid);
+ static Guid InvalidGuid();
/* Assignment */
Guid& operator=(const Guid& rhs);
@@ -80,23 +80,24 @@ 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;
};
//- Guid Inline Public Methods ------------------------------------------------
inline
-Guid::Guid()
- : m_GUID(INVALID_GUID)
+Guid::Guid(uint64_t guid)
+ : m_GUID(guid)
{
}
-inline
-Guid::Guid(uint64_t guid)
- : m_GUID(guid)
+inline Guid
+Guid::InvalidGuid()
{
+ return (Guid(INVALID_GUID));
}
inline Guid&