diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-10-13 13:21:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-10-13 13:35:12 -0400 |
commit | 257c62e1bce03e5b9f3f069fd52ad73a56de71fd (patch) | |
tree | ad047fe5796156aa88e3f3600111bf2b8d12759f /fs/btrfs/ctree.h | |
parent | 4722607db6a78bd7748c51fa4c8d7371da797254 (diff) |
Btrfs: avoid tree log commit when there are no changes
rpm has a habit of running fdatasync when the file hasn't
changed. We already detect if a file hasn't been changed
in the current transaction but it might have been sent to
the tree-log in this transaction and not changed since
the last call to fsync.
In this case, we want to avoid a tree log sync, which includes
a number of synchronous writes and barriers. This commit
extends the existing tracking of the last transaction to change
a file to also track the last sub-transaction.
The end result is that rpm -ivh and -Uvh are roughly twice as fast,
and on par with ext3.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 36a19cd43e03..d0cede5ff25e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1009,6 +1009,7 @@ struct btrfs_root { | |||
1009 | atomic_t log_writers; | 1009 | atomic_t log_writers; |
1010 | atomic_t log_commit[2]; | 1010 | atomic_t log_commit[2]; |
1011 | unsigned long log_transid; | 1011 | unsigned long log_transid; |
1012 | unsigned long last_log_commit; | ||
1012 | unsigned long log_batch; | 1013 | unsigned long log_batch; |
1013 | pid_t log_start_pid; | 1014 | pid_t log_start_pid; |
1014 | bool log_multiple_pids; | 1015 | bool log_multiple_pids; |