Fix TXG_MASK cstyle

Fix style issue for 'tx->tx_txg&TXG_MASK'.  There should be white
space around the '&' character.  Split the dnode_reallocate() ASSERT
to make it more readable to clearly separate the checks.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8606
This commit is contained in:
Brian Behlendorf 2019-04-12 11:30:59 -07:00 committed by GitHub
parent 9e3485abfc
commit 3fa93bb8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 16 deletions

View File

@ -3959,7 +3959,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
ASSERT(!list_link_active(&dr->dr_dirty_node)); ASSERT(!list_link_active(&dr->dr_dirty_node));
if (dn->dn_object == DMU_META_DNODE_OBJECT) { if (dn->dn_object == DMU_META_DNODE_OBJECT) {
list_insert_tail(&dn->dn_dirty_records[txg&TXG_MASK], dr); list_insert_tail(&dn->dn_dirty_records[txg & TXG_MASK], dr);
DB_DNODE_EXIT(db); DB_DNODE_EXIT(db);
} else { } else {
/* /*

View File

@ -1280,7 +1280,6 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
return (err); return (err);
err = dmu_free_long_object(rwa->os, slot); err = dmu_free_long_object(rwa->os, slot);
if (err != 0) if (err != 0)
return (err); return (err);
@ -1316,6 +1315,7 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro,
drro->drr_bonustype, drro->drr_bonuslen, drro->drr_bonustype, drro->drr_bonuslen,
dn_slots << DNODE_SHIFT, tx); dn_slots << DNODE_SHIFT, tx);
} }
if (err != 0) { if (err != 0) {
dmu_tx_commit(tx); dmu_tx_commit(tx);
return (SET_ERROR(EINVAL)); return (SET_ERROR(EINVAL));

View File

@ -415,7 +415,7 @@ dnode_rm_spill(dnode_t *dn, dmu_tx_t *tx)
ASSERT3U(zfs_refcount_count(&dn->dn_holds), >=, 1); ASSERT3U(zfs_refcount_count(&dn->dn_holds), >=, 1);
ASSERT(RW_WRITE_HELD(&dn->dn_struct_rwlock)); ASSERT(RW_WRITE_HELD(&dn->dn_struct_rwlock));
dnode_setdirty(dn, tx); dnode_setdirty(dn, tx);
dn->dn_rm_spillblk[tx->tx_txg&TXG_MASK] = DN_KILL_SPILLBLK; dn->dn_rm_spillblk[tx->tx_txg & TXG_MASK] = DN_KILL_SPILLBLK;
dn->dn_have_spill = B_FALSE; dn->dn_have_spill = B_FALSE;
} }
@ -690,14 +690,15 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
dnode_setdirty(dn, tx); dnode_setdirty(dn, tx);
if (dn->dn_datablksz != blocksize) { if (dn->dn_datablksz != blocksize) {
/* change blocksize */ /* change blocksize */
ASSERT(dn->dn_maxblkid == 0 && ASSERT0(dn->dn_maxblkid);
(BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || ASSERT(BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) ||
dnode_block_freed(dn, 0))); dnode_block_freed(dn, 0));
dnode_setdblksz(dn, blocksize); dnode_setdblksz(dn, blocksize);
dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; dn->dn_next_blksz[tx->tx_txg & TXG_MASK] = blocksize;
} }
if (dn->dn_bonuslen != bonuslen) if (dn->dn_bonuslen != bonuslen)
dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; dn->dn_next_bonuslen[tx->tx_txg & TXG_MASK] = bonuslen;
if (bonustype == DMU_OT_SA) /* Maximize bonus space for SA */ if (bonustype == DMU_OT_SA) /* Maximize bonus space for SA */
nblkptr = 1; nblkptr = 1;
@ -706,13 +707,14 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
1 + ((DN_SLOTS_TO_BONUSLEN(dn_slots) - bonuslen) >> 1 + ((DN_SLOTS_TO_BONUSLEN(dn_slots) - bonuslen) >>
SPA_BLKPTRSHIFT)); SPA_BLKPTRSHIFT));
if (dn->dn_bonustype != bonustype) if (dn->dn_bonustype != bonustype)
dn->dn_next_bonustype[tx->tx_txg&TXG_MASK] = bonustype; dn->dn_next_bonustype[tx->tx_txg & TXG_MASK] = bonustype;
if (dn->dn_nblkptr != nblkptr) if (dn->dn_nblkptr != nblkptr)
dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; dn->dn_next_nblkptr[tx->tx_txg & TXG_MASK] = nblkptr;
if (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { if (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
dbuf_rm_spill(dn, tx); dbuf_rm_spill(dn, tx);
dnode_rm_spill(dn, tx); dnode_rm_spill(dn, tx);
} }
rw_exit(&dn->dn_struct_rwlock); rw_exit(&dn->dn_struct_rwlock);
/* change type */ /* change type */
@ -1654,9 +1656,9 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx)
ASSERT(!zfs_refcount_is_zero(&dn->dn_holds) || ASSERT(!zfs_refcount_is_zero(&dn->dn_holds) ||
!avl_is_empty(&dn->dn_dbufs)); !avl_is_empty(&dn->dn_dbufs));
ASSERT(dn->dn_datablksz != 0); ASSERT(dn->dn_datablksz != 0);
ASSERT0(dn->dn_next_bonuslen[txg&TXG_MASK]); ASSERT0(dn->dn_next_bonuslen[txg & TXG_MASK]);
ASSERT0(dn->dn_next_blksz[txg&TXG_MASK]); ASSERT0(dn->dn_next_blksz[txg & TXG_MASK]);
ASSERT0(dn->dn_next_bonustype[txg&TXG_MASK]); ASSERT0(dn->dn_next_bonustype[txg & TXG_MASK]);
dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n", dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n",
dn->dn_object, txg); dn->dn_object, txg);

View File

@ -1168,10 +1168,10 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx)
ASSERT(dmu_tx_is_syncing(tx)); ASSERT(dmu_tx_is_syncing(tx));
mutex_enter(&dd->dd_lock); mutex_enter(&dd->dd_lock);
ASSERT0(dd->dd_tempreserved[tx->tx_txg&TXG_MASK]); ASSERT0(dd->dd_tempreserved[tx->tx_txg & TXG_MASK]);
dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg, dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg,
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] / 1024); dd->dd_space_towrite[tx->tx_txg & TXG_MASK] / 1024);
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] = 0; dd->dd_space_towrite[tx->tx_txg & TXG_MASK] = 0;
mutex_exit(&dd->dd_lock); mutex_exit(&dd->dd_lock);
/* release the hold from dsl_dir_dirty */ /* release the hold from dsl_dir_dirty */