提交 c8f2f24b 编写于 作者: J Josef Bacik

Btrfs: remove unused extent io tree ops V2

Nobody uses these io tree ops anymore so just remove them and clean up the code
a bit.  Thanks,
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
上级 210549eb
...@@ -2646,6 +2646,8 @@ static int __extent_read_full_page(struct extent_io_tree *tree, ...@@ -2646,6 +2646,8 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
} }
} }
while (cur <= end) { while (cur <= end) {
unsigned long pnr = (last_byte >> PAGE_CACHE_SHIFT) + 1;
if (cur >= last_byte) { if (cur >= last_byte) {
char *userpage; char *userpage;
struct extent_state *cached = NULL; struct extent_state *cached = NULL;
...@@ -2733,26 +2735,17 @@ static int __extent_read_full_page(struct extent_io_tree *tree, ...@@ -2733,26 +2735,17 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
continue; continue;
} }
ret = 0; pnr -= page->index;
if (tree->ops && tree->ops->readpage_io_hook) { ret = submit_extent_page(READ, tree, page,
ret = tree->ops->readpage_io_hook(page, cur,
cur + iosize - 1);
}
if (!ret) {
unsigned long pnr = (last_byte >> PAGE_CACHE_SHIFT) + 1;
pnr -= page->index;
ret = submit_extent_page(READ, tree, page,
sector, disk_io_size, pg_offset, sector, disk_io_size, pg_offset,
bdev, bio, pnr, bdev, bio, pnr,
end_bio_extent_readpage, mirror_num, end_bio_extent_readpage, mirror_num,
*bio_flags, *bio_flags,
this_bio_flag); this_bio_flag);
if (!ret) { if (!ret) {
nr++; nr++;
*bio_flags = this_bio_flag; *bio_flags = this_bio_flag;
} } else {
}
if (ret) {
SetPageError(page); SetPageError(page);
unlock_extent(tree, cur, cur + iosize - 1); unlock_extent(tree, cur, cur + iosize - 1);
} }
...@@ -3441,15 +3434,9 @@ static int extent_write_cache_pages(struct extent_io_tree *tree, ...@@ -3441,15 +3434,9 @@ static int extent_write_cache_pages(struct extent_io_tree *tree,
* swizzled back from swapper_space to tmpfs file * swizzled back from swapper_space to tmpfs file
* mapping * mapping
*/ */
if (tree->ops && if (!trylock_page(page)) {
tree->ops->write_cache_pages_lock_hook) { flush_fn(data);
tree->ops->write_cache_pages_lock_hook(page, lock_page(page);
data, flush_fn);
} else {
if (!trylock_page(page)) {
flush_fn(data);
lock_page(page);
}
} }
if (unlikely(page->mapping != mapping)) { if (unlikely(page->mapping != mapping)) {
......
...@@ -75,7 +75,6 @@ struct extent_io_ops { ...@@ -75,7 +75,6 @@ struct extent_io_ops {
int (*merge_bio_hook)(struct page *page, unsigned long offset, int (*merge_bio_hook)(struct page *page, unsigned long offset,
size_t size, struct bio *bio, size_t size, struct bio *bio,
unsigned long bio_flags); unsigned long bio_flags);
int (*readpage_io_hook)(struct page *page, u64 start, u64 end);
int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end, int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end,
struct extent_state *state, int mirror); struct extent_state *state, int mirror);
...@@ -90,8 +89,6 @@ struct extent_io_ops { ...@@ -90,8 +89,6 @@ struct extent_io_ops {
struct extent_state *other); struct extent_state *other);
void (*split_extent_hook)(struct inode *inode, void (*split_extent_hook)(struct inode *inode,
struct extent_state *orig, u64 split); struct extent_state *orig, u64 split);
int (*write_cache_pages_lock_hook)(struct page *page, void *data,
void (*flush_fn)(void *));
}; };
struct extent_io_tree { struct extent_io_tree {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册