diff options
author | Brian Behlendorf <[email protected]> | 2012-12-20 09:55:47 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-12-20 09:56:28 -0800 |
commit | d5446cfc528262ae3a41da31a8524c9d2e793f45 (patch) | |
tree | 7c058bae7c377b6766b7df884cb63293cdf22238 /module/zfs/zfs_log.c | |
parent | 23e3c743f6e36768b97234c3de18f4682111e6c3 (diff) |
Revert "Remove TSD zfs_fsyncer_key"
This reverts commit 31f2b5abdf95d8426d8bfd66ca7f62ec70215e3c back
to the original code until the fsync(2) performance regression
can be addressed.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/zfs_log.c')
-rw-r--r-- | module/zfs/zfs_log.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/module/zfs/zfs_log.c b/module/zfs/zfs_log.c index 4f144d553..cbd6f1cb4 100644 --- a/module/zfs/zfs_log.c +++ b/module/zfs/zfs_log.c @@ -457,6 +457,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, { itx_wr_state_t write_state; boolean_t slogging; + uintptr_t fsync_cnt; ssize_t immediate_write_sz; if (zil_replaying(zilog, tx) || zp->z_unlinked) @@ -474,6 +475,10 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, else write_state = WR_NEED_COPY; + if ((fsync_cnt = (uintptr_t)tsd_get(zfs_fsyncer_key)) != 0) { + (void) tsd_set(zfs_fsyncer_key, (void *)(fsync_cnt - 1)); + } + while (resid) { itx_t *itx; lr_write_t *lr; @@ -509,7 +514,8 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, itx->itx_private = ZTOZSB(zp); - if (!(ioflag & (FSYNC | FDSYNC)) && (zp->z_sync_cnt == 0)) + if (!(ioflag & (FSYNC | FDSYNC)) && (zp->z_sync_cnt == 0) && + (fsync_cnt == 0)) itx->itx_sync = B_FALSE; zil_itx_assign(zilog, itx, tx); |