MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dbuf_dnode_findbp

Function dbuf_dnode_findbp

freebsd/contrib/openzfs/module/zfs/dbuf.c:3037–3058  ·  view source on GitHub ↗

* This function returns a block pointer and information about the object, * given a dnode and a block. This is a publicly accessible version of * dbuf_findbp that only returns some information, rather than the * dbuf. Note that the dnode passed in must be held, and the dn_struct_rwlock * should be locked as (at least) a reader. */

Source from the content-addressed store, hash-verified

3035 * should be locked as (at least) a reader.
3036 */
3037int
3038dbuf_dnode_findbp(dnode_t *dn, uint64_t level, uint64_t blkid,
3039 blkptr_t *bp, uint16_t *datablkszsec, uint8_t *indblkshift)
3040{
3041 dmu_buf_impl_t *dbp = NULL;
3042 blkptr_t *bp2;
3043 int err = 0;
3044 ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock));
3045
3046 err = dbuf_findbp(dn, level, blkid, B_FALSE, &dbp, &bp2);
3047 if (err == 0) {
3048 *bp = *bp2;
3049 if (dbp != NULL)
3050 dbuf_rele(dbp, NULL);
3051 if (datablkszsec != NULL)
3052 *datablkszsec = dn->dn_phys->dn_datablkszsec;
3053 if (indblkshift != NULL)
3054 *indblkshift = dn->dn_phys->dn_indblkshift;
3055 }
3056
3057 return (err);
3058}
3059
3060typedef struct dbuf_prefetch_arg {
3061 spa_t *dpa_spa; /* The spa to issue the prefetch in. */

Callers 1

send_reader_threadFunction · 0.85

Calls 3

RW_LOCK_HELDFunction · 0.85
dbuf_findbpFunction · 0.85
dbuf_releFunction · 0.85

Tested by

no test coverage detected