summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason2008-09-11 22:17:57 +0200
committerChris Mason2008-09-25 17:04:07 +0200
commitd0c803c4049c5ca322d4795d8b74f28768603e0e (patch)
treeb4c4f11b2f5938ad183a1771cd0b9e122709e2ff /fs/btrfs/extent-tree.c
parentBtrfs: Copy into the log tree in big batches (diff)
downloadkernel-qcow2-linux-d0c803c4049c5ca322d4795d8b74f28768603e0e.tar.gz
kernel-qcow2-linux-d0c803c4049c5ca322d4795d8b74f28768603e0e.tar.xz
kernel-qcow2-linux-d0c803c4049c5ca322d4795d8b74f28768603e0e.zip
Btrfs: Record dirty pages tree-log pages in an extent_io tree
This is the same way the transaction code makes sure that all the other tree blocks are safely on disk. There's an extent_io tree for each root, and any blocks allocated to the tree logs are recorded in that tree. At tree-log sync, the extent_io tree is walked to flush down the dirty pages and wait for them. The main benefit is less time spent walking the tree log and skipping clean pages, and getting sequential IO down to the drive. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c479d71e2869..c0bb6b9ac4c6 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2392,8 +2392,13 @@ struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
btrfs_tree_lock(buf);
clean_tree_block(trans, root, buf);
btrfs_set_buffer_uptodate(buf);
- set_extent_dirty(&trans->transaction->dirty_pages, buf->start,
+ if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) {
+ set_extent_dirty(&root->dirty_log_pages, buf->start,
+ buf->start + buf->len - 1, GFP_NOFS);
+ } else {
+ set_extent_dirty(&trans->transaction->dirty_pages, buf->start,
buf->start + buf->len - 1, GFP_NOFS);
+ }
trans->blocks_used++;
return buf;
}