diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-09-11 16:11:19 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-09-17 15:47:36 -0400 |
commit | 11833d66be94b514652466802100378046c16b72 (patch) | |
tree | 2b00b36d0aa42e9e10cecf3bf723eb70a607afec /fs/btrfs/tree-log.c | |
parent | 6e74057c4686dc12ea767b4bdc50a63876056e1c (diff) | |
download | blackbird-op-linux-11833d66be94b514652466802100378046c16b72.tar.gz blackbird-op-linux-11833d66be94b514652466802100378046c16b72.zip |
Btrfs: improve async block group caching
This patch gets rid of two limitations of async block group caching.
The old code delays handling pinned extents when block group is in
caching. To allocate logged file extents, the old code need wait
until block group is fully cached. To get rid of the limitations,
This patch introduces a data structure to track the progress of
caching. Base on the caching progress, we know which extents should
be added to the free space cache when handling the pinned extents.
The logged file extents are also handled in a similar way.
This patch also changes how pinned extents are tracked. The old
code uses one tree to track pinned extents, and copy the pinned
extents tree at transaction commit time. This patch makes it use
two trees to track pinned extents. One tree for extents that are
pinned in the running transaction, one tree for extents that can
be unpinned. At transaction commit time, we swap the two trees.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 8661a7381b39..f4a7b62f9bea 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -263,8 +263,8 @@ static int process_one_buffer(struct btrfs_root *log, struct walk_control *wc, u64 gen) { if (wc->pin) - btrfs_update_pinned_extents(log->fs_info->extent_root, - eb->start, eb->len, 1); + btrfs_pin_extent(log->fs_info->extent_root, + eb->start, eb->len, 0); if (btrfs_buffer_uptodate(eb, gen)) { if (wc->write) |