mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
Remove bcopy(), bzero(), bcmp()
bcopy() has a confusing argument order and is actually a move, not a copy; they're all deprecated since POSIX.1-2001 and removed in -2008, and we shim them out to mem*() on Linux anyway Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12996
This commit is contained in:
@@ -82,7 +82,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx)
|
||||
ASSERT(db->db.db_data);
|
||||
ASSERT(arc_released(db->db_buf));
|
||||
ASSERT3U(sizeof (blkptr_t) * nblkptr, <=, db->db.db_size);
|
||||
bcopy(dn->dn_phys->dn_blkptr, db->db.db_data,
|
||||
memcpy(db->db.db_data, dn->dn_phys->dn_blkptr,
|
||||
sizeof (blkptr_t) * nblkptr);
|
||||
arc_buf_freeze(db->db_buf);
|
||||
|
||||
@@ -119,7 +119,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx)
|
||||
mutex_exit(&child->db_mtx);
|
||||
}
|
||||
|
||||
bzero(dn->dn_phys->dn_blkptr, sizeof (blkptr_t) * nblkptr);
|
||||
memset(dn->dn_phys->dn_blkptr, 0, sizeof (blkptr_t) * nblkptr);
|
||||
|
||||
rw_exit(&db->db_rwlock);
|
||||
if (dn->dn_dbuf != NULL)
|
||||
@@ -158,7 +158,7 @@ free_blocks(dnode_t *dn, blkptr_t *bp, int num, dmu_tx_t *tx)
|
||||
dmu_object_type_t type = BP_GET_TYPE(bp);
|
||||
uint64_t lvl = BP_GET_LEVEL(bp);
|
||||
|
||||
bzero(bp, sizeof (blkptr_t));
|
||||
memset(bp, 0, sizeof (blkptr_t));
|
||||
|
||||
if (spa_feature_is_active(dn->dn_objset->os_spa,
|
||||
SPA_FEATURE_HOLE_BIRTH)) {
|
||||
@@ -347,7 +347,7 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks,
|
||||
rw_enter(&db->db_rwlock, RW_WRITER);
|
||||
for (i = 0, bp = db->db.db_data; i < 1 << epbs; i++, bp++)
|
||||
ASSERT(BP_IS_HOLE(bp));
|
||||
bzero(db->db.db_data, db->db.db_size);
|
||||
memset(db->db.db_data, 0, db->db.db_size);
|
||||
free_blocks(dn, db->db_blkptr, 1, tx);
|
||||
rw_exit(&db->db_rwlock);
|
||||
}
|
||||
@@ -597,7 +597,7 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *tx)
|
||||
ASSERT(dn->dn_free_txg > 0);
|
||||
if (dn->dn_allocated_txg != dn->dn_free_txg)
|
||||
dmu_buf_will_dirty(&dn->dn_dbuf->db, tx);
|
||||
bzero(dn->dn_phys, sizeof (dnode_phys_t) * dn->dn_num_slots);
|
||||
memset(dn->dn_phys, 0, sizeof (dnode_phys_t) * dn->dn_num_slots);
|
||||
dnode_free_interior_slots(dn);
|
||||
|
||||
mutex_enter(&dn->dn_mtx);
|
||||
@@ -634,7 +634,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
|
||||
ASSERT(dmu_tx_is_syncing(tx));
|
||||
ASSERT(dnp->dn_type != DMU_OT_NONE || dn->dn_allocated_txg);
|
||||
ASSERT(dnp->dn_type != DMU_OT_NONE ||
|
||||
bcmp(dnp, &zerodn, DNODE_MIN_SIZE) == 0);
|
||||
memcmp(dnp, &zerodn, DNODE_MIN_SIZE) == 0);
|
||||
DNODE_VERIFY(dn);
|
||||
|
||||
ASSERT(dn->dn_dbuf == NULL || arc_released(dn->dn_dbuf->db_buf));
|
||||
@@ -827,7 +827,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
|
||||
ASSERT(dn->dn_allocated_txg == tx->tx_txg);
|
||||
if (dn->dn_next_nblkptr[txgoff] > dnp->dn_nblkptr) {
|
||||
/* zero the new blkptrs we are gaining */
|
||||
bzero(dnp->dn_blkptr + dnp->dn_nblkptr,
|
||||
memset(dnp->dn_blkptr + dnp->dn_nblkptr, 0,
|
||||
sizeof (blkptr_t) *
|
||||
(dn->dn_next_nblkptr[txgoff] - dnp->dn_nblkptr));
|
||||
#ifdef ZFS_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user