diff -r 6125224d77d0 ctree.c --- a/ctree.c Fri Aug 10 16:22:09 2007 -0400 +++ b/ctree.c Mon Aug 27 20:08:20 2007 +0800 @@ -2120,7 +2120,7 @@ int btrfs_next_leaf(struct btrfs_root *r if (!level) break; if (path->reada) - reada_for_search(root, path, level, slot); + reada_for_search(root, path, level, 0); next = read_tree_block(root, btrfs_node_blockptr(btrfs_buffer_node(next), 0)); } Regards YZ
It is hard to comment on this patch because there's no description for why you think it fixes block readahead. But, reada_for_search tries to cluster blocks close to the one indicated in path->nodes[level][slot], so always using slot=zero should make us cluster by the first block pointer in the node. The defrag code tries to keep the nodes mostly contiguous, but it should be better to cluster by the block we're actually looking for. -chris