Deleted Added
full compact
dnode_sync.c (236884) dnode_sync.c (240415)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 260 unchanged lines hidden (view full) ---

269 return (all ? ALL : blocks_freed);
270 }
271
272 for (i = start; i <= end; i++, bp++) {
273 if (BP_IS_HOLE(bp))
274 continue;
275 rw_enter(&dn->dn_struct_rwlock, RW_READER);
276 err = dbuf_hold_impl(dn, db->db_level-1, i, TRUE, FTAG, &subdb);
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 260 unchanged lines hidden (view full) ---

269 return (all ? ALL : blocks_freed);
270 }
271
272 for (i = start; i <= end; i++, bp++) {
273 if (BP_IS_HOLE(bp))
274 continue;
275 rw_enter(&dn->dn_struct_rwlock, RW_READER);
276 err = dbuf_hold_impl(dn, db->db_level-1, i, TRUE, FTAG, &subdb);
277 ASSERT3U(err, ==, 0);
277 ASSERT0(err);
278 rw_exit(&dn->dn_struct_rwlock);
279
280 if (free_children(subdb, blkid, nblks, trunc, tx) == ALL) {
281 ASSERT3P(subdb->db_blkptr, ==, bp);
282 blocks_freed += free_blocks(dn, bp, 1, tx);
283 } else {
284 all = FALSE;
285 }
286 dbuf_rele(subdb, FTAG);
287 }
288 DB_DNODE_EXIT(db);
289 arc_buf_freeze(db->db_buf);
290#ifdef ZFS_DEBUG
291 bp -= (end-start)+1;
292 for (i = start; i <= end; i++, bp++) {
293 if (i == start && blkid != 0)
294 continue;
295 else if (i == end && !trunc)
296 continue;
278 rw_exit(&dn->dn_struct_rwlock);
279
280 if (free_children(subdb, blkid, nblks, trunc, tx) == ALL) {
281 ASSERT3P(subdb->db_blkptr, ==, bp);
282 blocks_freed += free_blocks(dn, bp, 1, tx);
283 } else {
284 all = FALSE;
285 }
286 dbuf_rele(subdb, FTAG);
287 }
288 DB_DNODE_EXIT(db);
289 arc_buf_freeze(db->db_buf);
290#ifdef ZFS_DEBUG
291 bp -= (end-start)+1;
292 for (i = start; i <= end; i++, bp++) {
293 if (i == start && blkid != 0)
294 continue;
295 else if (i == end && !trunc)
296 continue;
297 ASSERT3U(bp->blk_birth, ==, 0);
297 ASSERT0(bp->blk_birth);
298 }
299#endif
300 ASSERT(all || blocks_freed == 0 || db->db_last_dirty);
301 return (all ? ALL : blocks_freed);
302}
303
304/*
305 * free_range: Traverse the indicated range of the provided file

--- 39 unchanged lines hidden (view full) ---

345 ASSERT(start < dn->dn_phys->dn_nblkptr);
346 end = (blkid + nblks - 1) >> shift;
347 bp += start;
348 for (i = start; i <= end; i++, bp++) {
349 if (BP_IS_HOLE(bp))
350 continue;
351 rw_enter(&dn->dn_struct_rwlock, RW_READER);
352 err = dbuf_hold_impl(dn, dnlevel-1, i, TRUE, FTAG, &db);
298 }
299#endif
300 ASSERT(all || blocks_freed == 0 || db->db_last_dirty);
301 return (all ? ALL : blocks_freed);
302}
303
304/*
305 * free_range: Traverse the indicated range of the provided file

--- 39 unchanged lines hidden (view full) ---

345 ASSERT(start < dn->dn_phys->dn_nblkptr);
346 end = (blkid + nblks - 1) >> shift;
347 bp += start;
348 for (i = start; i <= end; i++, bp++) {
349 if (BP_IS_HOLE(bp))
350 continue;
351 rw_enter(&dn->dn_struct_rwlock, RW_READER);
352 err = dbuf_hold_impl(dn, dnlevel-1, i, TRUE, FTAG, &db);
353 ASSERT3U(err, ==, 0);
353 ASSERT0(err);
354 rw_exit(&dn->dn_struct_rwlock);
355
356 if (free_children(db, blkid, nblks, trunc, tx) == ALL) {
357 ASSERT3P(db->db_blkptr, ==, bp);
358 (void) free_blocks(dn, bp, 1, tx);
359 }
360 dbuf_rele(db, FTAG);
361 }

--- 107 unchanged lines hidden (view full) ---

469 int txgoff = tx->tx_txg & TXG_MASK;
470
471 ASSERT(dmu_tx_is_syncing(tx));
472
473 /*
474 * Our contents should have been freed in dnode_sync() by the
475 * free range record inserted by the caller of dnode_free().
476 */
354 rw_exit(&dn->dn_struct_rwlock);
355
356 if (free_children(db, blkid, nblks, trunc, tx) == ALL) {
357 ASSERT3P(db->db_blkptr, ==, bp);
358 (void) free_blocks(dn, bp, 1, tx);
359 }
360 dbuf_rele(db, FTAG);
361 }

--- 107 unchanged lines hidden (view full) ---

469 int txgoff = tx->tx_txg & TXG_MASK;
470
471 ASSERT(dmu_tx_is_syncing(tx));
472
473 /*
474 * Our contents should have been freed in dnode_sync() by the
475 * free range record inserted by the caller of dnode_free().
476 */
477 ASSERT3U(DN_USED_BYTES(dn->dn_phys), ==, 0);
477 ASSERT0(DN_USED_BYTES(dn->dn_phys));
478 ASSERT(BP_IS_HOLE(dn->dn_phys->dn_blkptr));
479
480 dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]);
481 dnode_evict_dbufs(dn);
482 ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL);
483
484 /*
485 * XXX - It would be nice to assert this, but we may still

--- 213 unchanged lines hidden ---
478 ASSERT(BP_IS_HOLE(dn->dn_phys->dn_blkptr));
479
480 dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]);
481 dnode_evict_dbufs(dn);
482 ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL);
483
484 /*
485 * XXX - It would be nice to assert this, but we may still

--- 213 unchanged lines hidden ---