summaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-02 10:01:11 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit8f662a76c6af8eb367fa519e9bb9766040d9cea8 (patch)
tree3072a4d35c49e2c884f41d044dec4950bf95c3b3 /fs/btrfs/ctree.c
parente52ec0eb62e76ea584c8438ef92933e9b815db80 (diff)
downloadlwn-8f662a76c6af8eb367fa519e9bb9766040d9cea8.tar.gz
lwn-8f662a76c6af8eb367fa519e9bb9766040d9cea8.zip
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.c9
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,
*/
int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
{
+ u64 bytenr;
int slot;
int level = 1;
- u64 bytenr;
struct extent_buffer *c;
struct extent_buffer *next = NULL;
@@ -2687,11 +2687,14 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
level--;
c = path->nodes[level];
free_extent_buffer(c);
+ slot = btrfs_header_nritems(next);
+ if (slot != 0)
+ slot--;
path->nodes[level] = next;
- path->slots[level] = 0;
+ path->slots[level] = slot;
if (!level)
break;
- next = read_tree_block(root, btrfs_node_blockptr(next, 0),
+ next = read_tree_block(root, btrfs_node_blockptr(next, slot),
btrfs_level_size(root, level - 1));
}
return 0;