Remove few pointer dereferences in dbuf_read()
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Closes #14199
This commit is contained in:
parent
04a6ae0585
commit
edaa250bb3
|
@ -1483,8 +1483,8 @@ dbuf_read_verify_dnode_crypt(dmu_buf_impl_t *db, uint32_t flags)
|
||||||
|
|
||||||
ASSERT(MUTEX_HELD(&db->db_mtx));
|
ASSERT(MUTEX_HELD(&db->db_mtx));
|
||||||
|
|
||||||
if (!os->os_encrypted || os->os_raw_receive ||
|
if ((flags & DB_RF_NO_DECRYPT) != 0 ||
|
||||||
(flags & DB_RF_NO_DECRYPT) != 0)
|
!os->os_encrypted || os->os_raw_receive)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
DB_DNODE_ENTER(db);
|
DB_DNODE_ENTER(db);
|
||||||
|
@ -1719,8 +1719,6 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
|
||||||
|
|
||||||
mutex_enter(&db->db_mtx);
|
mutex_enter(&db->db_mtx);
|
||||||
if (db->db_state == DB_CACHED) {
|
if (db->db_state == DB_CACHED) {
|
||||||
spa_t *spa = dn->dn_objset->os_spa;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ensure that this block's dnode has been decrypted if
|
* Ensure that this block's dnode has been decrypted if
|
||||||
* the caller has requested decrypted data.
|
* the caller has requested decrypted data.
|
||||||
|
@ -1739,6 +1737,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
|
||||||
(arc_is_encrypted(db->db_buf) ||
|
(arc_is_encrypted(db->db_buf) ||
|
||||||
arc_is_unauthenticated(db->db_buf) ||
|
arc_is_unauthenticated(db->db_buf) ||
|
||||||
arc_get_compression(db->db_buf) != ZIO_COMPRESS_OFF)) {
|
arc_get_compression(db->db_buf) != ZIO_COMPRESS_OFF)) {
|
||||||
|
spa_t *spa = dn->dn_objset->os_spa;
|
||||||
zbookmark_phys_t zb;
|
zbookmark_phys_t zb;
|
||||||
|
|
||||||
SET_BOOKMARK(&zb, dmu_objset_id(db->db_objset),
|
SET_BOOKMARK(&zb, dmu_objset_id(db->db_objset),
|
||||||
|
@ -1755,13 +1754,13 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
|
||||||
DB_DNODE_EXIT(db);
|
DB_DNODE_EXIT(db);
|
||||||
DBUF_STAT_BUMP(hash_hits);
|
DBUF_STAT_BUMP(hash_hits);
|
||||||
} else if (db->db_state == DB_UNCACHED) {
|
} else if (db->db_state == DB_UNCACHED) {
|
||||||
spa_t *spa = dn->dn_objset->os_spa;
|
|
||||||
boolean_t need_wait = B_FALSE;
|
boolean_t need_wait = B_FALSE;
|
||||||
|
|
||||||
db_lock_type_t dblt = dmu_buf_lock_parent(db, RW_READER, FTAG);
|
db_lock_type_t dblt = dmu_buf_lock_parent(db, RW_READER, FTAG);
|
||||||
|
|
||||||
if (zio == NULL &&
|
if (zio == NULL &&
|
||||||
db->db_blkptr != NULL && !BP_IS_HOLE(db->db_blkptr)) {
|
db->db_blkptr != NULL && !BP_IS_HOLE(db->db_blkptr)) {
|
||||||
|
spa_t *spa = dn->dn_objset->os_spa;
|
||||||
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
|
zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL);
|
||||||
need_wait = B_TRUE;
|
need_wait = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2425,19 +2425,11 @@ dnode_spill_freed(dnode_t *dn)
|
||||||
uint64_t
|
uint64_t
|
||||||
dnode_block_freed(dnode_t *dn, uint64_t blkid)
|
dnode_block_freed(dnode_t *dn, uint64_t blkid)
|
||||||
{
|
{
|
||||||
void *dp = spa_get_dsl(dn->dn_objset->os_spa);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (blkid == DMU_BONUS_BLKID)
|
if (blkid == DMU_BONUS_BLKID)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
/*
|
|
||||||
* If we're in the process of opening the pool, dp will not be
|
|
||||||
* set yet, but there shouldn't be anything dirty.
|
|
||||||
*/
|
|
||||||
if (dp == NULL)
|
|
||||||
return (FALSE);
|
|
||||||
|
|
||||||
if (dn->dn_free_txg)
|
if (dn->dn_free_txg)
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue