]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix tree logs parallel sync
authorYan Zheng <zheng.yan@oracle.com>
Wed, 21 Jan 2009 17:54:03 +0000 (12:54 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 21 Jan 2009 17:54:03 +0000 (12:54 -0500)
commiteb9af2c68a647a49a59cb66979c6924f41b465c7
tree5e12b9a7655f03181605e02fd91b42e68ee92c2e
parent66f522f8540f19e2183ebe4f10b0273551a03a0a
Btrfs: fix tree logs parallel sync

To improve performance, btrfs_sync_log merges tree log sync
requests. But it wrongly merges sync requests for different
tree logs. If multiple tree logs are synced at the same time,
only one of them actually gets synced.

This patch has following changes to fix the bug:

Move most tree log related fields in btrfs_fs_info to
btrfs_root. This allows merging sync requests separately
for each tree log.

Don't insert root item into the log root tree immediately
after log tree is allocated. Root item for log tree is
inserted when log tree get synced for the first time. This
allows syncing the log root tree without first syncing all
log trees.

At tree-log sync, btrfs_sync_log first sync the log tree;
then updates corresponding root item in the log root tree;
sync the log root tree; then update the super block.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/tree-log.c