* 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. */
| 3035 | * should be locked as (at least) a reader. |
| 3036 | */ |
| 3037 | int |
| 3038 | dbuf_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 | |
| 3060 | typedef struct dbuf_prefetch_arg { |
| 3061 | spa_t *dpa_spa; /* The spa to issue the prefetch in. */ |
no test coverage detected