Skip to content

Commit a6bb723

Browse files
author
Paul Dagnelie
committed
Don't must_gang
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent 6d5b66b commit a6bb723

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

include/sys/zio.h

-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ typedef struct zio_prop {
358358
boolean_t zp_encrypt;
359359
boolean_t zp_byteorder;
360360
boolean_t zp_direct_write;
361-
boolean_t zp_must_gang;
362361
uint8_t zp_salt[ZIO_DATA_SALT_LEN];
363362
uint8_t zp_iv[ZIO_DATA_IV_LEN];
364363
uint8_t zp_mac[ZIO_DATA_MAC_LEN];

module/zfs/dmu.c

-1
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,6 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
24932493
zp->zp_encrypt = encrypt;
24942494
zp->zp_byteorder = ZFS_HOST_BYTEORDER;
24952495
zp->zp_direct_write = (wp & WP_DIRECT_WR) ? B_TRUE : B_FALSE;
2496-
zp->zp_must_gang = B_FALSE;
24972496
memset(zp->zp_salt, 0, ZIO_DATA_SALT_LEN);
24982497
memset(zp->zp_iv, 0, ZIO_DATA_IV_LEN);
24992498
memset(zp->zp_mac, 0, ZIO_DATA_MAC_LEN);

module/zfs/zio.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -3240,7 +3240,6 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc)
32403240
zp.zp_encrypt = gio->io_prop.zp_encrypt;
32413241
zp.zp_byteorder = gio->io_prop.zp_byteorder;
32423242
zp.zp_direct_write = B_FALSE;
3243-
zp.zp_must_gang = B_FALSE;
32443243
memset(zp.zp_salt, 0, ZIO_DATA_SALT_LEN);
32453244
memset(zp.zp_iv, 0, ZIO_DATA_IV_LEN);
32463245
memset(zp.zp_mac, 0, ZIO_DATA_MAC_LEN);
@@ -3944,18 +3943,21 @@ zio_ddt_write(zio_t *zio)
39443943
need_dvas -= parent_dvas;
39453944
}
39463945

3946+
if (gang_dvas > 0 && have_dvas > 0) {
3947+
zp->zp_dedup = B_FALSE;
3948+
BP_SET_DEDUP(bp, B_FALSE);
3949+
zio->io_pipeline = ZIO_WRITE_PIPELINE;
3950+
ddt_exit(ddt);
3951+
return (zio);
3952+
}
3953+
39473954
/*
39483955
* We need to write. We will create a new write with the copies
39493956
* property adjusted to match the number of DVAs we need to need to
39503957
* grow the DDT entry by to satisfy the request.
39513958
*/
39523959
zio_prop_t czp = *zp;
3953-
if (gang_dvas > 0 && have_dvas > 0) {
3954-
czp.zp_gang_copies = need_dvas +
3955-
(zp->zp_gang_copies - zp->zp_copies);
3956-
czp.zp_copies = need_dvas;
3957-
czp.zp_must_gang = B_TRUE;
3958-
} else if (gang_dvas == 0 && have_dvas > 0) {
3960+
if (gang_dvas == 0 && have_dvas > 0) {
39593961
czp.zp_copies = need_dvas;
39603962
czp.zp_gang_copies = 0;
39613963
} else {
@@ -4167,15 +4169,14 @@ zio_dva_allocate(zio_t *zio)
41674169
* back to spa_sync() which is abysmal for performance.
41684170
*/
41694171
ASSERT(ZIO_HAS_ALLOCATOR(zio));
4170-
error = zio->io_prop.zp_must_gang ? ENOSPC : metaslab_alloc(spa,
4171-
mc, zio->io_size, bp, zio->io_prop.zp_copies, zio->io_txg, NULL,
4172-
flags, &zio->io_alloc_list, zio, zio->io_allocator);
4172+
error = metaslab_alloc(spa, mc, zio->io_size, bp,
4173+
zio->io_prop.zp_copies, zio->io_txg, NULL, flags,
4174+
&zio->io_alloc_list, zio, zio->io_allocator);
41734175

41744176
/*
41754177
* Fallback to normal class when an alloc class is full
41764178
*/
4177-
if (error == ENOSPC && mc != spa_normal_class(spa) &&
4178-
!zio->io_prop.zp_must_gang) {
4179+
if (error == ENOSPC && mc != spa_normal_class(spa)) {
41794180
/*
41804181
* When the dedup or special class is spilling into the normal
41814182
* class, there can still be significant space available due
@@ -4227,8 +4228,7 @@ zio_dva_allocate(zio_t *zio)
42274228
}
42284229

42294230
if (error == ENOSPC && zio->io_size > SPA_MINBLOCKSIZE) {
4230-
if (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC &&
4231-
!zio->io_prop.zp_must_gang) {
4231+
if (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC) {
42324232
zfs_dbgmsg("%s: metaslab allocation failure, "
42334233
"trying ganging: zio %px, size %llu, error %d",
42344234
spa_name(spa), zio, (u_longlong_t)zio->io_size,

0 commit comments

Comments
 (0)