btrfs: Remove unused arguments from btrfs_get_extent_fiemap
authorNikolay Borisov <nborisov@suse.com>
Wed, 12 Dec 2018 07:42:32 +0000 (09:42 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:17 +0000 (14:13 +0100)
This function is a simple wrapper over btrfs_get_extent that returns
either:

a) A real extent in the passed range or
b) Adjusted extent based on whether delalloc bytes are found backing up
   a hole.

To support these semantics it doesn't need the page/pg_offset/create
arguments which are passed to btrfs_get_extent in case an extent is to
be created. So simplify the function by removing the unused arguments.
No functional changes.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent_io.c
fs/btrfs/file.c
fs/btrfs/inode.c

index ae0e21b7c79f9627c8e38d072fbe706e08a1aa86..fecc64d8e285f79e6af3be2c7268b7468630577b 100644 (file)
@@ -3181,8 +3181,7 @@ void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,
 
 /* inode.c */
 struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode,
-               struct page *page, size_t pg_offset, u64 start,
-               u64 len, int create);
+                                          u64 start, u64 len);
 noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len,
                              u64 *orig_start, u64 *orig_block_len,
                              u64 *ram_bytes);
index 52abe408268088575db22ce79b851ee2f529a0c0..ca87fbae33646e1f0c56ccdbea552a2cf5f8e739 100644 (file)
@@ -4259,8 +4259,7 @@ static struct extent_map *get_extent_skip_holes(struct inode *inode,
                if (len == 0)
                        break;
                len = ALIGN(len, sectorsize);
-               em = btrfs_get_extent_fiemap(BTRFS_I(inode), NULL, 0, offset,
-                               len, 0);
+               em = btrfs_get_extent_fiemap(BTRFS_I(inode), offset, len);
                if (IS_ERR_OR_NULL(em))
                        return em;
 
index d38dc8c31533773df9ac8cef15254319df824cba..34fe8a58b0e9cb65d5faddfcec1b655858ed8589 100644 (file)
@@ -3218,8 +3218,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
                         &cached_state);
 
        while (start < inode->i_size) {
-               em = btrfs_get_extent_fiemap(BTRFS_I(inode), NULL, 0,
-                               start, len, 0);
+               em = btrfs_get_extent_fiemap(BTRFS_I(inode), start, len);
                if (IS_ERR(em)) {
                        ret = PTR_ERR(em);
                        em = NULL;
index 41d6d97252c555bee673314fc73c5b3d587c27c8..a35f63691cf84bc963e76aaada64c2dab965587c 100644 (file)
@@ -6945,9 +6945,7 @@ out:
 }
 
 struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode,
-               struct page *page,
-               size_t pg_offset, u64 start, u64 len,
-               int create)
+                                          u64 start, u64 len)
 {
        struct extent_map *em;
        struct extent_map *hole_em = NULL;
@@ -6957,7 +6955,7 @@ struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode,
        u64 found_end;
        int err = 0;
 
-       em = btrfs_get_extent(inode, page, pg_offset, start, len, create);
+       em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
        if (IS_ERR(em))
                return em;
        /*