Deleted Added
full compact
dnode.c (254753) dnode.c (258632)
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

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

1788 } else {
1789 dn->dn_phys->dn_used = space;
1790 dn->dn_phys->dn_flags |= DNODE_FLAG_USED_BYTES;
1791 }
1792 mutex_exit(&dn->dn_mtx);
1793}
1794
1795/*
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

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

1788 } else {
1789 dn->dn_phys->dn_used = space;
1790 dn->dn_phys->dn_flags |= DNODE_FLAG_USED_BYTES;
1791 }
1792 mutex_exit(&dn->dn_mtx);
1793}
1794
1795/*
1796 * Call when we think we're going to write/free space in open context.
1797 * Be conservative (ie. OK to write less than this or free more than
1798 * this, but don't write more or free less).
1796 * Call when we think we're going to write/free space in open context to track
1797 * the amount of memory in use by the currently open txg.
1799 */
1800void
1801dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx)
1802{
1803 objset_t *os = dn->dn_objset;
1804 dsl_dataset_t *ds = os->os_dsl_dataset;
1798 */
1799void
1800dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx)
1801{
1802 objset_t *os = dn->dn_objset;
1803 dsl_dataset_t *ds = os->os_dsl_dataset;
1804 int64_t aspace = spa_get_asize(os->os_spa, space);
1805
1805
1806 if (space > 0)
1807 space = spa_get_asize(os->os_spa, space);
1806 if (ds != NULL) {
1807 dsl_dir_willuse_space(ds->ds_dir, aspace, tx);
1808 dsl_pool_dirty_space(dmu_tx_pool(tx), space, tx);
1809 }
1808
1810
1809 if (ds)
1810 dsl_dir_willuse_space(ds->ds_dir, space, tx);
1811
1812 dmu_tx_willuse_space(tx, space);
1811 dmu_tx_willuse_space(tx, aspace);
1813}
1814
1815/*
1816 * Scans a block at the indicated "level" looking for a hole or data,
1817 * depending on 'flags'.
1818 *
1819 * If level > 0, then we are scanning an indirect block looking at its
1820 * pointers. If level == 0, then we are looking at a block of dnodes.

--- 192 unchanged lines hidden ---
1812}
1813
1814/*
1815 * Scans a block at the indicated "level" looking for a hole or data,
1816 * depending on 'flags'.
1817 *
1818 * If level > 0, then we are scanning an indirect block looking at its
1819 * pointers. If level == 0, then we are looking at a block of dnodes.

--- 192 unchanged lines hidden ---