Print this page
Possibility to physically reserve space without writing leaf blocks

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dnode.c
          +++ new/usr/src/uts/common/fs/zfs/dnode.c
↓ open down ↓ 1291 lines elided ↑ open up ↑
1292 1292           * The dnode maintains a hold on its containing dbuf as
1293 1293           * long as there are holds on it.  Each instantiated child
1294 1294           * dbuf maintains a hold on the dnode.  When the last child
1295 1295           * drops its hold, the dnode will drop its hold on the
1296 1296           * containing dbuf. We add a "dirty hold" here so that the
1297 1297           * dnode will hang around after we finish processing its
1298 1298           * children.
1299 1299           */
1300 1300          VERIFY(dnode_add_ref(dn, (void *)(uintptr_t)tx->tx_txg));
1301 1301  
1302      -        (void) dbuf_dirty(dn->dn_dbuf, tx);
     1302 +        (void) dbuf_dirty(dn->dn_dbuf, tx, B_FALSE);
1303 1303  
1304 1304          dsl_dataset_dirty(os->os_dsl_dataset, tx);
1305 1305  }
1306 1306  
1307 1307  void
1308 1308  dnode_free(dnode_t *dn, dmu_tx_t *tx)
1309 1309  {
1310 1310          int txgoff = tx->tx_txg & TXG_MASK;
1311 1311  
1312 1312          dprintf("dn=%p txg=%llu\n", dn, tx->tx_txg);
↓ open down ↓ 142 lines elided ↑ open up ↑
1455 1455                  dbuf_dirty_record_t *new, *dr, *dr_next;
1456 1456  
1457 1457                  dn->dn_nlevels = new_nlevels;
1458 1458  
1459 1459                  ASSERT3U(new_nlevels, >, dn->dn_next_nlevels[txgoff]);
1460 1460                  dn->dn_next_nlevels[txgoff] = new_nlevels;
1461 1461  
1462 1462                  /* dirty the left indirects */
1463 1463                  db = dbuf_hold_level(dn, old_nlevels, 0, FTAG);
1464 1464                  ASSERT(db != NULL);
1465      -                new = dbuf_dirty(db, tx);
     1465 +                new = dbuf_dirty(db, tx, B_FALSE);
1466 1466                  dbuf_rele(db, FTAG);
1467 1467  
1468 1468                  /* transfer the dirty records to the new indirect */
1469 1469                  mutex_enter(&dn->dn_mtx);
1470 1470                  mutex_enter(&new->dt.di.dr_mtx);
1471 1471                  list = &dn->dn_dirty_records[txgoff];
1472 1472                  for (dr = list_head(list); dr; dr = dr_next) {
1473 1473                          dr_next = list_next(&dn->dn_dirty_records[txgoff], dr);
1474 1474                          if (dr->dr_dbuf->db_level != new_nlevels-1 &&
1475 1475                              dr->dr_dbuf->db_blkid != DMU_BONUS_BLKID &&
↓ open down ↓ 488 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX