aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu_tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/dmu_tx.c')
-rw-r--r--module/zfs/dmu_tx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c
index 4159ba740..4f2fae2fc 100644
--- a/module/zfs/dmu_tx.c
+++ b/module/zfs/dmu_tx.c
@@ -1251,7 +1251,6 @@ dmu_tx_unassign(dmu_tx_t *tx)
int
dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
{
- hrtime_t before;
int err;
ASSERT(tx->tx_txg == 0);
@@ -1259,8 +1258,6 @@ dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
txg_how == TXG_WAITED);
ASSERT(!dsl_pool_sync_context(tx->tx_pool));
- before = gethrtime();
-
if (txg_how == TXG_WAITED)
tx->tx_waited = B_TRUE;
@@ -1278,8 +1275,6 @@ dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how)
txg_rele_to_quiesce(&tx->tx_txgh);
- spa_tx_assign_add_nsecs(tx->tx_pool->dp_spa, gethrtime() - before);
-
return (0);
}
@@ -1288,10 +1283,13 @@ dmu_tx_wait(dmu_tx_t *tx)
{
spa_t *spa = tx->tx_pool->dp_spa;
dsl_pool_t *dp = tx->tx_pool;
+ hrtime_t before;
ASSERT(tx->tx_txg == 0);
ASSERT(!dsl_pool_config_held(tx->tx_pool));
+ before = gethrtime();
+
if (tx->tx_wait_dirty) {
uint64_t dirty;
@@ -1343,6 +1341,8 @@ dmu_tx_wait(dmu_tx_t *tx)
*/
txg_wait_open(tx->tx_pool, tx->tx_lasttried_txg + 1);
}
+
+ spa_tx_assign_add_nsecs(spa, gethrtime() - before);
}
void