aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 94627c4cc193..4a86508ce473 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4919,8 +4919,16 @@ struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
4919 btrfs_set_buffer_uptodate(buf); 4919 btrfs_set_buffer_uptodate(buf);
4920 4920
4921 if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) { 4921 if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) {
4922 set_extent_dirty(&root->dirty_log_pages, buf->start, 4922 /*
4923 buf->start + buf->len - 1, GFP_NOFS); 4923 * we allow two log transactions at a time, use different
4924 * EXENT bit to differentiate dirty pages.
4925 */
4926 if (root->log_transid % 2 == 0)
4927 set_extent_dirty(&root->dirty_log_pages, buf->start,
4928 buf->start + buf->len - 1, GFP_NOFS);
4929 else
4930 set_extent_new(&root->dirty_log_pages, buf->start,
4931 buf->start + buf->len - 1, GFP_NOFS);
4924 } else { 4932 } else {
4925 set_extent_dirty(&trans->transaction->dirty_pages, buf->start, 4933 set_extent_dirty(&trans->transaction->dirty_pages, buf->start,
4926 buf->start + buf->len - 1, GFP_NOFS); 4934 buf->start + buf->len - 1, GFP_NOFS);