Skip to content

Commit

Permalink
fix the style
Browse files Browse the repository at this point in the history
  • Loading branch information
jxdking committed Apr 10, 2021
1 parent b1a8793 commit 90f25ec
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions module/zfs/dsl_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ int zfs_dirty_data_max_percent = 10;
int zfs_dirty_data_max_max_percent = 25;

/*
* zfs_wrlog_data_max (the upper limit of TX_WRITE log data).
* zfs_wrlog_data_max (the upper limit of TX_WRITE log data).
* It only counts TX_WRITE log with WR_COPIED or WR_NEED_COPY.
* This defaults to the same value of zfs_dirty_data_max
*
* zfs_wrlog_data_sync_percent, the least TX_WRITE log data (as a percentage of zfs_wrlog_data_max)
* to push a txg.
* zfs_wrlog_data_sync_percent, the least TX_WRITE log data
* (as a percentage of zfs_wrlog_data_max)
* to push a txg.
*/
unsigned long zfs_wrlog_data_max = 0;
int zfs_wrlog_data_sync_percent = 30;
Expand Down Expand Up @@ -607,22 +608,23 @@ dsl_pool_dirty_delta(dsl_pool_t *dp, int64_t delta)
cv_signal(&dp->dp_spaceavail_cv);
}

void
void
dsl_pool_wrlog_delay(int64_t size, dsl_pool_t *dp, uint64_t txg)
{
mutex_enter(&dp->dp_wrlog_lock);
dp->dp_wrlog_total += size;
dp->dp_wrlog_pertxg[txg & TXG_MASK] += size;
mutex_exit(&dp->dp_wrlog_lock);

while (dp->dp_wrlog_total > zfs_wrlog_data_max) {
txg_kick(dp);
txg_wait_synced(dp, spa_last_synced_txg(dp->dp_spa) + 1);
}

if (dp->dp_wrlog_total >= zfs_wrlog_data_sync_percent * zfs_wrlog_data_max / 100) {
if (dp->dp_wrlog_total >=
zfs_wrlog_data_sync_percent * zfs_wrlog_data_max / 100) {
txg_kick(dp);
}
}
}

static void
Expand Down

0 comments on commit 90f25ec

Please sign in to comment.