Commit 06de96fa authored by David Sterba's avatar David Sterba
Browse files

btrfs: rename __get_extent_map() and pass btrfs_inode



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: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3a1c46db
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -896,7 +896,7 @@ void clear_folio_extent_mapped(struct folio *folio)
	folio_detach_private(folio);
}

static struct extent_map *__get_extent_map(struct inode *inode,
static struct extent_map *get_extent_map(struct btrfs_inode *inode,
					 struct folio *folio, u64 start,
					 u64 len, struct extent_map **em_cached)
{
@@ -917,14 +917,14 @@ static struct extent_map *__get_extent_map(struct inode *inode,
		*em_cached = NULL;
	}

	btrfs_lock_and_flush_ordered_range(BTRFS_I(inode), start, start + len - 1, &cached_state);
	em = btrfs_get_extent(BTRFS_I(inode), folio, start, len);
	btrfs_lock_and_flush_ordered_range(inode, start, start + len - 1, &cached_state);
	em = btrfs_get_extent(inode, folio, start, len);
	if (!IS_ERR(em)) {
		BUG_ON(*em_cached);
		refcount_inc(&em->refs);
		*em_cached = em;
	}
	unlock_extent(&BTRFS_I(inode)->io_tree, start, start + len - 1, &cached_state);
	unlock_extent(&inode->io_tree, start, start + len - 1, &cached_state);

	return em;
}
@@ -980,8 +980,7 @@ static int btrfs_do_readpage(struct folio *folio, struct extent_map **em_cached,
			end_folio_read(folio, true, cur, iosize);
			break;
		}
		em = __get_extent_map(inode, folio, cur, end - cur + 1,
				      em_cached);
		em = get_extent_map(BTRFS_I(inode), folio, cur, end - cur + 1, em_cached);
		if (IS_ERR(em)) {
			end_folio_read(folio, false, cur, end + 1 - cur);
			return PTR_ERR(em);