MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vdev_copy_path_search

Function vdev_copy_path_search

freebsd/contrib/openzfs/module/zfs/vdev.c:2299–2325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2297}
2298
2299static void
2300vdev_copy_path_search(vdev_t *stvd, vdev_t *dvd)
2301{
2302 ASSERT(stvd->vdev_top == stvd);
2303 ASSERT3U(stvd->vdev_id, ==, dvd->vdev_top->vdev_id);
2304
2305 for (uint64_t i = 0; i < dvd->vdev_children; i++) {
2306 vdev_copy_path_search(stvd, dvd->vdev_child[i]);
2307 }
2308
2309 if (!dvd->vdev_ops->vdev_op_leaf || !vdev_is_concrete(dvd))
2310 return;
2311
2312 /*
2313 * The idea here is that while a vdev can shift positions within
2314 * a top vdev (when replacing, attaching mirror, etc.) it cannot
2315 * step outside of it.
2316 */
2317 vdev_t *vd = vdev_lookup_by_guid(stvd, dvd->vdev_guid);
2318
2319 if (vd == NULL || vd->vdev_ops != dvd->vdev_ops)
2320 return;
2321
2322 ASSERT(vd->vdev_ops->vdev_op_leaf);
2323
2324 vdev_copy_path_impl(vd, dvd);
2325}
2326
2327/*
2328 * Recursively copy vdev paths from one root vdev to another. Source and

Callers 1

vdev_copy_path_relaxedFunction · 0.85

Calls 3

vdev_is_concreteFunction · 0.85
vdev_lookup_by_guidFunction · 0.85
vdev_copy_path_implFunction · 0.85

Tested by

no test coverage detected