diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-02 10:01:11 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | 8f662a76c6af8eb367fa519e9bb9766040d9cea8 (patch) | |
tree | 3072a4d35c49e2c884f41d044dec4950bf95c3b3 /fs/btrfs/ctree.c | |
parent | e52ec0eb62e76ea584c8438ef92933e9b815db80 (diff) |
Btrfs: Add readahead to the online shrinker, and a mount -o alloc_start= for testing
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2b3ffa707eae..8fa92a2d9819 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -2654,9 +2654,9 @@ int btrfs_del_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
2654 | */ | 2654 | */ |
2655 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) | 2655 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) |
2656 | { | 2656 | { |
2657 | u64 bytenr; | ||
2657 | int slot; | 2658 | int slot; |
2658 | int level = 1; | 2659 | int level = 1; |
2659 | u64 bytenr; | ||
2660 | struct extent_buffer *c; | 2660 | struct extent_buffer *c; |
2661 | struct extent_buffer *next = NULL; | 2661 | struct extent_buffer *next = NULL; |
2662 | 2662 | ||
@@ -2687,11 +2687,14 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) | |||
2687 | level--; | 2687 | level--; |
2688 | c = path->nodes[level]; | 2688 | c = path->nodes[level]; |
2689 | free_extent_buffer(c); | 2689 | free_extent_buffer(c); |
2690 | slot = btrfs_header_nritems(next); | ||
2691 | if (slot != 0) | ||
2692 | slot--; | ||
2690 | path->nodes[level] = next; | 2693 | path->nodes[level] = next; |
2691 | path->slots[level] = 0; | 2694 | path->slots[level] = slot; |
2692 | if (!level) | 2695 | if (!level) |
2693 | break; | 2696 | break; |
2694 | next = read_tree_block(root, btrfs_node_blockptr(next, 0), | 2697 | next = read_tree_block(root, btrfs_node_blockptr(next, slot), |
2695 | btrfs_level_size(root, level - 1)); | 2698 | btrfs_level_size(root, level - 1)); |
2696 | } | 2699 | } |
2697 | return 0; | 2700 | return 0; |