Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131702206
D12791.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D12791.diff
View Options
Index: head/cddl/usr.sbin/zfsd/case_file.h
===================================================================
--- head/cddl/usr.sbin/zfsd/case_file.h
+++ head/cddl/usr.sbin/zfsd/case_file.h
@@ -89,6 +89,8 @@
* \brief Find a CaseFile object by a vdev's pool/vdev GUID tuple.
*
* \param poolGUID Pool GUID for the vdev of the CaseFile to find.
+ * If InvalidGuid, then only match the vdev GUID
+ * instead of both pool and vdev GUIDs.
* \param vdevGUID Vdev GUID for the vdev of the CaseFile to find.
*
* \return If found, a pointer to a valid CaseFile object.
Index: head/cddl/usr.sbin/zfsd/case_file.cc
===================================================================
--- head/cddl/usr.sbin/zfsd/case_file.cc
+++ head/cddl/usr.sbin/zfsd/case_file.cc
@@ -102,7 +102,8 @@
for (CaseFileList::iterator curCase = s_activeCases.begin();
curCase != s_activeCases.end(); curCase++) {
- if ((*curCase)->PoolGUID() != poolGUID
+ if (((*curCase)->PoolGUID() != poolGUID
+ && Guid::InvalidGuid() != poolGUID)
|| (*curCase)->VdevGUID() != vdevGUID)
continue;
@@ -268,7 +269,8 @@
}
if (vdev != NULL
- && vdev->PoolGUID() == m_poolGUID
+ && ( vdev->PoolGUID() == m_poolGUID
+ || vdev->PoolGUID() == Guid::InvalidGuid())
&& vdev->GUID() == m_vdevGUID) {
zpool_vdev_online(pool, vdev->GUIDString().c_str(),
Index: head/cddl/usr.sbin/zfsd/vdev_iterator.cc
===================================================================
--- head/cddl/usr.sbin/zfsd/vdev_iterator.cc
+++ head/cddl/usr.sbin/zfsd/vdev_iterator.cc
@@ -76,7 +76,9 @@
VdevIterator::Reset()
{
nvlist_t *rootVdev;
+ nvlist **cache_child;
int result;
+ uint_t cache_children;
result = nvlist_lookup_nvlist(m_poolConfig,
ZPOOL_CONFIG_VDEV_TREE,
@@ -85,6 +87,13 @@
throw ZfsdException(m_poolConfig, "Unable to extract "
"ZPOOL_CONFIG_VDEV_TREE from pool.");
m_vdevQueue.assign(1, rootVdev);
+ result = nvlist_lookup_nvlist_array(rootVdev,
+ ZPOOL_CONFIG_L2CACHE,
+ &cache_child,
+ &cache_children);
+ if (result == 0)
+ for (uint_t c = 0; c < cache_children; c++)
+ m_vdevQueue.push_back(cache_child[c]);
}
nvlist_t *
Index: head/lib/libdevdctl/guid.h
===================================================================
--- head/lib/libdevdctl/guid.h
+++ head/lib/libdevdctl/guid.h
@@ -62,9 +62,9 @@
{
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 @@
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&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 11:38 AM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23575455
Default Alt Text
D12791.diff (3 KB)
Attached To
Mode
D12791: zfsd should be able to online an L2ARC that disappears and returns
Attached
Detach File
Event Timeline
Log In to Comment