Skip to content

Commit 7cbe070

Browse files
kdavegregkh
authored andcommitted
btrfs: rename __get_extent_map() and pass btrfs_inode
[ Upstream commit 06de96f ] The double underscore naming scheme does not apply here, there's only only get_extent_map(). As the definition is changed also pass the struct btrfs_inode. Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]> Stable-dep-of: acc18e1 ("btrfs: fix stale page cache after race between readahead and direct IO write") Signed-off-by: Sasha Levin <[email protected]>
1 parent 8e92d6a commit 7cbe070

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

fs/btrfs/extent_io.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,9 @@ void clear_folio_extent_mapped(struct folio *folio)
901901
folio_detach_private(folio);
902902
}
903903

904-
static struct extent_map *__get_extent_map(struct inode *inode,
905-
struct folio *folio, u64 start,
906-
u64 len, struct extent_map **em_cached)
904+
static struct extent_map *get_extent_map(struct btrfs_inode *inode,
905+
struct folio *folio, u64 start,
906+
u64 len, struct extent_map **em_cached)
907907
{
908908
struct extent_map *em;
909909
struct extent_state *cached_state = NULL;
@@ -922,14 +922,14 @@ static struct extent_map *__get_extent_map(struct inode *inode,
922922
*em_cached = NULL;
923923
}
924924

925-
btrfs_lock_and_flush_ordered_range(BTRFS_I(inode), start, start + len - 1, &cached_state);
926-
em = btrfs_get_extent(BTRFS_I(inode), folio, start, len);
925+
btrfs_lock_and_flush_ordered_range(inode, start, start + len - 1, &cached_state);
926+
em = btrfs_get_extent(inode, folio, start, len);
927927
if (!IS_ERR(em)) {
928928
BUG_ON(*em_cached);
929929
refcount_inc(&em->refs);
930930
*em_cached = em;
931931
}
932-
unlock_extent(&BTRFS_I(inode)->io_tree, start, start + len - 1, &cached_state);
932+
unlock_extent(&inode->io_tree, start, start + len - 1, &cached_state);
933933

934934
return em;
935935
}
@@ -985,8 +985,7 @@ static int btrfs_do_readpage(struct folio *folio, struct extent_map **em_cached,
985985
end_folio_read(folio, true, cur, iosize);
986986
break;
987987
}
988-
em = __get_extent_map(inode, folio, cur, end - cur + 1,
989-
em_cached);
988+
em = get_extent_map(BTRFS_I(inode), folio, cur, end - cur + 1, em_cached);
990989
if (IS_ERR(em)) {
991990
end_folio_read(folio, false, cur, end + 1 - cur);
992991
return PTR_ERR(em);

0 commit comments

Comments
 (0)