Commit ed7b63eb authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: only clear dirty on the buffer if it is marked as dirty

No reason to set the path blocking or loop through all of the pages if the
extent buffer isn't actually marked dirty.  Thanks,
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent bb146eb2
...@@ -1142,12 +1142,12 @@ void clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root, ...@@ -1142,12 +1142,12 @@ void clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,
root->fs_info->dirty_metadata_bytes); root->fs_info->dirty_metadata_bytes);
} }
spin_unlock(&root->fs_info->delalloc_lock); spin_unlock(&root->fs_info->delalloc_lock);
}
/* ugh, clear_extent_buffer_dirty needs to lock the page */ /* ugh, clear_extent_buffer_dirty needs to lock the page */
btrfs_set_lock_blocking(buf); btrfs_set_lock_blocking(buf);
clear_extent_buffer_dirty(buf); clear_extent_buffer_dirty(buf);
} }
}
} }
static void __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, static void __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment