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

Function vdev_checkpoint_sm_object

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

* Gets the checkpoint space map object from the vdev's ZAP. On success sm_obj * will contain either the checkpoint spacemap object or zero if none exists. * All other errors are returned to the caller. */

Source from the content-addressed store, hash-verified

3237 * All other errors are returned to the caller.
3238 */
3239int
3240vdev_checkpoint_sm_object(vdev_t *vd, uint64_t *sm_obj)
3241{
3242 ASSERT0(spa_config_held(vd->vdev_spa, SCL_ALL, RW_WRITER));
3243
3244 if (vd->vdev_top_zap == 0) {
3245 *sm_obj = 0;
3246 return (0);
3247 }
3248
3249 int error = zap_lookup(spa_meta_objset(vd->vdev_spa), vd->vdev_top_zap,
3250 VDEV_TOP_ZAP_POOL_CHECKPOINT_SM, sizeof (uint64_t), 1, sm_obj);
3251 if (error == ENOENT) {
3252 *sm_obj = 0;
3253 error = 0;
3254 }
3255
3256 return (error);
3257}
3258
3259int
3260vdev_load(vdev_t *vd)

Callers 1

vdev_loadFunction · 0.85

Calls 3

spa_config_heldFunction · 0.85
zap_lookupFunction · 0.85
spa_meta_objsetFunction · 0.85

Tested by

no test coverage detected