Skip to content

Commit ce38507

Browse files
author
Paul Dagnelie
committed
Alexander feedback
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
1 parent a6bb723 commit ce38507

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

include/sys/ddt.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ extern ddt_phys_variant_t ddt_phys_select(const ddt_t *ddt,
352352
const ddt_entry_t *dde, const blkptr_t *bp);
353353
extern uint64_t ddt_phys_birth(const ddt_univ_phys_t *ddp,
354354
ddt_phys_variant_t v);
355-
extern int ddt_phys_gang_count(const ddt_univ_phys_t *ddp,
356-
ddt_phys_variant_t v, boolean_t encrypted);
355+
extern int ddt_phys_is_gang(const ddt_univ_phys_t *ddp,
356+
ddt_phys_variant_t v);
357357
extern int ddt_phys_dva_count(const ddt_univ_phys_t *ddp, ddt_phys_variant_t v,
358358
boolean_t encrypted);
359359

module/zfs/ddt.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -815,17 +815,14 @@ ddt_phys_birth(const ddt_univ_phys_t *ddp, ddt_phys_variant_t v)
815815
}
816816

817817
int
818-
ddt_phys_gang_count(const ddt_univ_phys_t *ddp, ddt_phys_variant_t v,
819-
boolean_t encrypted)
818+
ddt_phys_is_gang(const ddt_univ_phys_t *ddp, ddt_phys_variant_t v)
820819
{
821820
ASSERT3U(v, <, DDT_PHYS_NONE);
822821

823822
const dva_t *dvas = (v == DDT_PHYS_FLAT) ?
824823
ddp->ddp_flat.ddp_dva : ddp->ddp_trad[v].ddp_dva;
825824

826-
return (DVA_GET_GANG(&dvas[0]) +
827-
DVA_GET_GANG(&dvas[1] +
828-
DVA_GET_GANG(&dvas[2]) * !encrypted));
825+
return (DVA_GET_GANG(&dvas[0]));
829826
}
830827

831828
int

module/zfs/zio.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3795,7 +3795,7 @@ zio_ddt_write(zio_t *zio)
37953795
*/
37963796
int have_dvas = ddt_phys_dva_count(ddp, v, BP_IS_ENCRYPTED(bp));
37973797
IMPLY(have_dvas == 0, ddt_phys_birth(ddp, v) == 0);
3798-
int gang_dvas = ddt_phys_gang_count(ddp, v, BP_IS_ENCRYPTED(bp));
3798+
boolean_t is_ganged = ddt_phys_is_gang(ddp, v);
37993799

38003800
/* Number of DVAs requested by the IO. */
38013801
uint8_t need_dvas = zp->zp_copies;
@@ -3943,7 +3943,7 @@ zio_ddt_write(zio_t *zio)
39433943
need_dvas -= parent_dvas;
39443944
}
39453945

3946-
if (gang_dvas > 0 && have_dvas > 0) {
3946+
if (is_ganged) {
39473947
zp->zp_dedup = B_FALSE;
39483948
BP_SET_DEDUP(bp, B_FALSE);
39493949
zio->io_pipeline = ZIO_WRITE_PIPELINE;
@@ -3957,7 +3957,7 @@ zio_ddt_write(zio_t *zio)
39573957
* grow the DDT entry by to satisfy the request.
39583958
*/
39593959
zio_prop_t czp = *zp;
3960-
if (gang_dvas == 0 && have_dvas > 0) {
3960+
if (have_dvas > 0) {
39613961
czp.zp_copies = need_dvas;
39623962
czp.zp_gang_copies = 0;
39633963
} else {

0 commit comments

Comments
 (0)