Skip to content

Commit fe2ca28

Browse files
committed
clean up code in vdev_raidz_map_alloc
1 parent 6c23e3a commit fe2ca28

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

module/zfs/vdev_raidz.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -440,22 +440,23 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_t ashift, uint64_t dcols,
440440
col -= dcols;
441441
coff += 1ULL << ashift;
442442
}
443-
rr->rr_col[c].rc_devidx = col;
444-
rr->rr_col[c].rc_offset = coff;
445-
rr->rr_col[c].rc_abd = NULL;
446-
rr->rr_col[c].rc_gdata = NULL;
447-
rr->rr_col[c].rc_orig_data = NULL;
448-
rr->rr_col[c].rc_error = 0;
449-
rr->rr_col[c].rc_tried = 0;
450-
rr->rr_col[c].rc_skipped = 0;
451-
rr->rr_col[c].rc_need_orig_restore = B_FALSE;
443+
raidz_col_t *rc = &rr->rr_col[c];
444+
rc->rc_devidx = col;
445+
rc->rc_offset = coff;
446+
rc->rc_abd = NULL;
447+
rc->rc_gdata = NULL;
448+
rc->rc_orig_data = NULL;
449+
rc->rc_error = 0;
450+
rc->rc_tried = 0;
451+
rc->rc_skipped = 0;
452+
rc->rc_need_orig_restore = B_FALSE;
452453

453454
if (c < bc)
454-
rr->rr_col[c].rc_size = (q + 1) << ashift;
455+
rc->rc_size = (q + 1) << ashift;
455456
else
456-
rr->rr_col[c].rc_size = q << ashift;
457+
rc->rc_size = q << ashift;
457458

458-
asize += rr->rr_col[c].rc_size;
459+
asize += rc->rc_size;
459460
}
460461

461462
ASSERT3U(asize, ==, tot << ashift);
@@ -470,9 +471,9 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_t ashift, uint64_t dcols,
470471
off = rr->rr_col[c].rc_size;
471472

472473
for (c = c + 1; c < acols; c++) {
473-
rr->rr_col[c].rc_abd = abd_get_offset_size(zio->io_abd, off,
474-
rr->rr_col[c].rc_size);
475-
off += rr->rr_col[c].rc_size;
474+
raidz_col_t *rc = &rr->rr_col[c];
475+
rc->rc_abd = abd_get_offset_size(zio->io_abd, off, rc->rc_size);
476+
off += rc->rc_size;
476477
}
477478

478479
/*

0 commit comments

Comments
 (0)