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

@ -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

@ -690,9 +690,10 @@ 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;
} }
@ -713,6 +714,7 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
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 */