Btrfs: remove unused extent io tree ops V2
authorJosef Bacik <jbacik@fusionio.com>
Mon, 11 Feb 2013 16:33:00 +0000 (11:33 -0500)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 17:59:52 +0000 (12:59 -0500)
Nobody uses these io tree ops anymore so just remove them and clean up the code
a bit.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h

index b9019c847c58a3fab298018c994507bb951b1d9f..5c00d6aeae755a45f28f5a81fab6a4c863444a7d 100644 (file)
@@ -2646,6 +2646,8 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
                }
        }
        while (cur <= end) {
+               unsigned long pnr = (last_byte >> PAGE_CACHE_SHIFT) + 1;
+
                if (cur >= last_byte) {
                        char *userpage;
                        struct extent_state *cached = NULL;
@@ -2733,26 +2735,17 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
                        continue;
                }
 
-               ret = 0;
-               if (tree->ops && tree->ops->readpage_io_hook) {
-                       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,
+               pnr -= page->index;
+               ret = submit_extent_page(READ, tree, page,
                                         sector, disk_io_size, pg_offset,
                                         bdev, bio, pnr,
                                         end_bio_extent_readpage, mirror_num,
                                         *bio_flags,
                                         this_bio_flag);
-                       if (!ret) {
-                               nr++;
-                               *bio_flags = this_bio_flag;
-                       }
-               }
-               if (ret) {
+               if (!ret) {
+                       nr++;
+                       *bio_flags = this_bio_flag;
+               } else {
                        SetPageError(page);
                        unlock_extent(tree, cur, cur + iosize - 1);
                }
@@ -3441,15 +3434,9 @@ retry:
                         * swizzled back from swapper_space to tmpfs file
                         * mapping
                         */
-                       if (tree->ops &&
-                           tree->ops->write_cache_pages_lock_hook) {
-                               tree->ops->write_cache_pages_lock_hook(page,
-                                                              data, flush_fn);
-                       } else {
-                               if (!trylock_page(page)) {
-                                       flush_fn(data);
-                                       lock_page(page);
-                               }
+                       if (!trylock_page(page)) {
+                               flush_fn(data);
+                               lock_page(page);
                        }
 
                        if (unlikely(page->mapping != mapping)) {
index 2eacfabd32632e90056e76cc5a678ecce6c6504a..ff182322d112bfbe8827710dec4ddf464670cda5 100644 (file)
@@ -75,7 +75,6 @@ struct extent_io_ops {
        int (*merge_bio_hook)(struct page *page, unsigned long offset,
                              size_t size, struct bio *bio,
                              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_end_io_hook)(struct page *page, u64 start, u64 end,
                                    struct extent_state *state, int mirror);
@@ -90,8 +89,6 @@ struct extent_io_ops {
                                  struct extent_state *other);
        void (*split_extent_hook)(struct inode *inode,
                                  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 {