* 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. */
| 3237 | * All other errors are returned to the caller. |
| 3238 | */ |
| 3239 | int |
| 3240 | vdev_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 | |
| 3259 | int |
| 3260 | vdev_load(vdev_t *vd) |
no test coverage detected