@@ -651,3 +651,17 @@ void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv)
{
write_extent_buffer(eb, srcv, btrfs_header_fsid(), BTRFS_FSID_SIZE);
}
+
+/*
+ * btrfs_readahead_node_child - readahead a node's child block
+ * @node: parent node we're reading from
+ * @slot: slot in the parent node for the child we want to read
+ *
+ * A helper for readahead_tree_block, we simply read the bytenr pointed at the
+ * slot in the node provided.
+ */
+void btrfs_readahead_node_child(struct extent_buffer *node, int slot)
+{
+ readahead_tree_block(node->fs_info, btrfs_node_blockptr(node, slot),
+ btrfs_node_ptr_generation(node, slot));
+}
@@ -137,5 +137,6 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start,
void extent_buffer_init_cache(struct btrfs_fs_info *fs_info);
void extent_buffer_free_cache(struct btrfs_fs_info *fs_info);
void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv);
+void btrfs_readahead_node_child(struct extent_buffer *node, int slot);
#endif
This exists in the kernel as a wrapper for readahead_tree_block, and is used extensively in ctree.c in the kernel. Sync this helper so that we can easily sync ctree.c Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/extent_io.c | 14 ++++++++++++++ kernel-shared/extent_io.h | 1 + 2 files changed, 15 insertions(+)