return TRUE if this blkid was freed in a recent txg, or FALSE if it wasn't */
| 2282 | |
| 2283 | /* return TRUE if this blkid was freed in a recent txg, or FALSE if it wasn't */ |
| 2284 | uint64_t |
| 2285 | dnode_block_freed(dnode_t *dn, uint64_t blkid) |
| 2286 | { |
| 2287 | void *dp = spa_get_dsl(dn->dn_objset->os_spa); |
| 2288 | int i; |
| 2289 | |
| 2290 | if (blkid == DMU_BONUS_BLKID) |
| 2291 | return (FALSE); |
| 2292 | |
| 2293 | /* |
| 2294 | * If we're in the process of opening the pool, dp will not be |
| 2295 | * set yet, but there shouldn't be anything dirty. |
| 2296 | */ |
| 2297 | if (dp == NULL) |
| 2298 | return (FALSE); |
| 2299 | |
| 2300 | if (dn->dn_free_txg) |
| 2301 | return (TRUE); |
| 2302 | |
| 2303 | if (blkid == DMU_SPILL_BLKID) |
| 2304 | return (dnode_spill_freed(dn)); |
| 2305 | |
| 2306 | mutex_enter(&dn->dn_mtx); |
| 2307 | for (i = 0; i < TXG_SIZE; i++) { |
| 2308 | if (dn->dn_free_ranges[i] != NULL && |
| 2309 | range_tree_contains(dn->dn_free_ranges[i], blkid, 1)) |
| 2310 | break; |
| 2311 | } |
| 2312 | mutex_exit(&dn->dn_mtx); |
| 2313 | return (i < TXG_SIZE); |
| 2314 | } |
| 2315 | |
| 2316 | /* call from syncing context when we actually write/free space for this dnode */ |
| 2317 | void |
no test coverage detected