Commit e3350e16 authored by David Sterba's avatar David Sterba

btrfs: sink get_extent parameter to get_extent_skip_holes

All callers pass btrfs_get_extent_fiemap and get_extent_skip_holes
itself is used only as a fiemap helper.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2135fb9b
...@@ -4292,9 +4292,7 @@ int try_release_extent_mapping(struct extent_map_tree *map, ...@@ -4292,9 +4292,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
* This maps until we find something past 'last' * This maps until we find something past 'last'
*/ */
static struct extent_map *get_extent_skip_holes(struct inode *inode, static struct extent_map *get_extent_skip_holes(struct inode *inode,
u64 offset, u64 offset, u64 last)
u64 last,
get_extent_t *get_extent)
{ {
u64 sectorsize = btrfs_inode_sectorsize(inode); u64 sectorsize = btrfs_inode_sectorsize(inode);
struct extent_map *em; struct extent_map *em;
...@@ -4308,7 +4306,8 @@ static struct extent_map *get_extent_skip_holes(struct inode *inode, ...@@ -4308,7 +4306,8 @@ static struct extent_map *get_extent_skip_holes(struct inode *inode,
if (len == 0) if (len == 0)
break; break;
len = ALIGN(len, sectorsize); len = ALIGN(len, sectorsize);
em = get_extent(BTRFS_I(inode), NULL, 0, offset, len, 0); em = btrfs_get_extent_fiemap(BTRFS_I(inode), NULL, 0, offset,
len, 0);
if (IS_ERR_OR_NULL(em)) if (IS_ERR_OR_NULL(em))
return em; return em;
...@@ -4523,8 +4522,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -4523,8 +4522,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1, lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1,
&cached_state); &cached_state);
em = get_extent_skip_holes(inode, start, last_for_get_extent, em = get_extent_skip_holes(inode, start, last_for_get_extent);
btrfs_get_extent_fiemap);
if (!em) if (!em)
goto out; goto out;
if (IS_ERR(em)) { if (IS_ERR(em)) {
...@@ -4612,8 +4610,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -4612,8 +4610,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
} }
/* now scan forward to see if this is really the last extent. */ /* now scan forward to see if this is really the last extent. */
em = get_extent_skip_holes(inode, off, last_for_get_extent, em = get_extent_skip_holes(inode, off, last_for_get_extent);
btrfs_get_extent_fiemap);
if (IS_ERR(em)) { if (IS_ERR(em)) {
ret = PTR_ERR(em); ret = PTR_ERR(em);
goto out; goto out;
......
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