| @@ -3360,27 +3360,27 @@ metaslab_class_throttle_unreserve(metasl | | | @@ -3360,27 +3360,27 @@ metaslab_class_throttle_unreserve(metasl |
3360 | mutex_enter(&mc->mc_lock); | | 3360 | mutex_enter(&mc->mc_lock); |
3361 | for (int d = 0; d < slots; d++) { | | 3361 | for (int d = 0; d < slots; d++) { |
3362 | (void) refcount_remove(&mc->mc_alloc_slots, zio); | | 3362 | (void) refcount_remove(&mc->mc_alloc_slots, zio); |
3363 | } | | 3363 | } |
3364 | mutex_exit(&mc->mc_lock); | | 3364 | mutex_exit(&mc->mc_lock); |
3365 | } | | 3365 | } |
3366 | | | 3366 | |
3367 | int | | 3367 | int |
3368 | metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, | | 3368 | metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, |
3369 | int ndvas, uint64_t txg, blkptr_t *hintbp, int flags, | | 3369 | int ndvas, uint64_t txg, blkptr_t *hintbp, int flags, |
3370 | zio_alloc_list_t *zal, zio_t *zio) | | 3370 | zio_alloc_list_t *zal, zio_t *zio) |
3371 | { | | 3371 | { |
3372 | dva_t *dva = bp->blk_dva; | | 3372 | dva_t *dva = bp->blk_dva; |
3373 | dva_t *hintdva = hintbp->blk_dva; | | 3373 | dva_t *hintdva = (hintbp != NULL) ? hintbp->blk_dva : NULL; |
3374 | int error = 0; | | 3374 | int error = 0; |
3375 | | | 3375 | |
3376 | ASSERT(bp->blk_birth == 0); | | 3376 | ASSERT(bp->blk_birth == 0); |
3377 | ASSERT(BP_PHYSICAL_BIRTH(bp) == 0); | | 3377 | ASSERT(BP_PHYSICAL_BIRTH(bp) == 0); |
3378 | | | 3378 | |
3379 | spa_config_enter(spa, SCL_ALLOC, FTAG, RW_READER); | | 3379 | spa_config_enter(spa, SCL_ALLOC, FTAG, RW_READER); |
3380 | | | 3380 | |
3381 | if (mc->mc_rotor == NULL) { /* no vdevs in this class */ | | 3381 | if (mc->mc_rotor == NULL) { /* no vdevs in this class */ |
3382 | spa_config_exit(spa, SCL_ALLOC, FTAG); | | 3382 | spa_config_exit(spa, SCL_ALLOC, FTAG); |
3383 | return (SET_ERROR(ENOSPC)); | | 3383 | return (SET_ERROR(ENOSPC)); |
3384 | } | | 3384 | } |
3385 | | | 3385 | |
3386 | ASSERT(ndvas > 0 && ndvas <= spa_max_replication(spa)); | | 3386 | ASSERT(ndvas > 0 && ndvas <= spa_max_replication(spa)); |