Commit 6af49dbd authored by David Sterba's avatar David Sterba

btrfs: sink get_extent parameter to read_extent_buffer_pages

All callers pass btree_get_extent, which needs to be exported.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4ef77695
...@@ -220,7 +220,7 @@ void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, ...@@ -220,7 +220,7 @@ void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb,
* extents on the btree inode are pretty simple, there's one extent * extents on the btree inode are pretty simple, there's one extent
* that covers the entire device * that covers the entire device
*/ */
static struct extent_map *btree_get_extent(struct btrfs_inode *inode, struct extent_map *btree_get_extent(struct btrfs_inode *inode,
struct page *page, size_t pg_offset, u64 start, u64 len, struct page *page, size_t pg_offset, u64 start, u64 len,
int create) int create)
{ {
...@@ -455,7 +455,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info, ...@@ -455,7 +455,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info,
io_tree = &BTRFS_I(fs_info->btree_inode)->io_tree; io_tree = &BTRFS_I(fs_info->btree_inode)->io_tree;
while (1) { while (1) {
ret = read_extent_buffer_pages(io_tree, eb, WAIT_COMPLETE, ret = read_extent_buffer_pages(io_tree, eb, WAIT_COMPLETE,
btree_get_extent, mirror_num); mirror_num);
if (!ret) { if (!ret) {
if (!verify_parent_transid(io_tree, eb, if (!verify_parent_transid(io_tree, eb,
parent_transid, 0)) parent_transid, 0))
...@@ -1012,7 +1012,7 @@ void readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr) ...@@ -1012,7 +1012,7 @@ void readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr)
if (IS_ERR(buf)) if (IS_ERR(buf))
return; return;
read_extent_buffer_pages(&BTRFS_I(btree_inode)->io_tree, read_extent_buffer_pages(&BTRFS_I(btree_inode)->io_tree,
buf, WAIT_NONE, btree_get_extent, 0); buf, WAIT_NONE, 0);
free_extent_buffer(buf); free_extent_buffer(buf);
} }
...@@ -1031,7 +1031,7 @@ int reada_tree_block_flagged(struct btrfs_fs_info *fs_info, u64 bytenr, ...@@ -1031,7 +1031,7 @@ int reada_tree_block_flagged(struct btrfs_fs_info *fs_info, u64 bytenr,
set_bit(EXTENT_BUFFER_READAHEAD, &buf->bflags); set_bit(EXTENT_BUFFER_READAHEAD, &buf->bflags);
ret = read_extent_buffer_pages(io_tree, buf, WAIT_PAGE_LOCK, ret = read_extent_buffer_pages(io_tree, buf, WAIT_PAGE_LOCK,
btree_get_extent, mirror_num); mirror_num);
if (ret) { if (ret) {
free_extent_buffer(buf); free_extent_buffer(buf);
return ret; return ret;
......
...@@ -149,6 +149,9 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, ...@@ -149,6 +149,9 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
u64 objectid); u64 objectid);
int btree_lock_page_hook(struct page *page, void *data, int btree_lock_page_hook(struct page *page, void *data,
void (*flush_fn)(void *)); void (*flush_fn)(void *));
struct extent_map *btree_get_extent(struct btrfs_inode *inode,
struct page *page, size_t pg_offset, u64 start, u64 len,
int create);
int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags); int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags);
int __init btrfs_end_io_wq_init(void); int __init btrfs_end_io_wq_init(void);
void btrfs_end_io_wq_exit(void); void btrfs_end_io_wq_exit(void);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "locking.h" #include "locking.h"
#include "rcu-string.h" #include "rcu-string.h"
#include "backref.h" #include "backref.h"
#include "disk-io.h"
static struct kmem_cache *extent_state_cache; static struct kmem_cache *extent_state_cache;
static struct kmem_cache *extent_buffer_cache; static struct kmem_cache *extent_buffer_cache;
...@@ -5248,8 +5249,7 @@ int extent_buffer_uptodate(struct extent_buffer *eb) ...@@ -5248,8 +5249,7 @@ int extent_buffer_uptodate(struct extent_buffer *eb)
} }
int read_extent_buffer_pages(struct extent_io_tree *tree, int read_extent_buffer_pages(struct extent_io_tree *tree,
struct extent_buffer *eb, int wait, struct extent_buffer *eb, int wait, int mirror_num)
get_extent_t *get_extent, int mirror_num)
{ {
unsigned long i; unsigned long i;
struct page *page; struct page *page;
...@@ -5309,7 +5309,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, ...@@ -5309,7 +5309,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree,
ClearPageError(page); ClearPageError(page);
err = __extent_read_full_page(tree, page, err = __extent_read_full_page(tree, page,
get_extent, &bio, btree_get_extent, &bio,
mirror_num, &bio_flags, mirror_num, &bio_flags,
REQ_META); REQ_META);
if (err) { if (err) {
......
...@@ -435,7 +435,7 @@ void free_extent_buffer_stale(struct extent_buffer *eb); ...@@ -435,7 +435,7 @@ void free_extent_buffer_stale(struct extent_buffer *eb);
#define WAIT_PAGE_LOCK 2 #define WAIT_PAGE_LOCK 2
int read_extent_buffer_pages(struct extent_io_tree *tree, int read_extent_buffer_pages(struct extent_io_tree *tree,
struct extent_buffer *eb, int wait, struct extent_buffer *eb, int wait,
get_extent_t *get_extent, int mirror_num); int mirror_num);
void wait_on_extent_buffer_writeback(struct extent_buffer *eb); void wait_on_extent_buffer_writeback(struct extent_buffer *eb);
static inline unsigned long num_extent_pages(u64 start, u64 len) static inline unsigned long num_extent_pages(u64 start, u64 len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment