summaryrefslogtreecommitdiff
path: root/fs/erofs/data.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-07 03:04:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2024-04-07 03:04:50 -0400
commit469ad583c1293f5d9f45183050b3beeb4a8c3475 (patch)
treec1574e7e19e7c92ba206be0ca135a195df420bf4 /fs/erofs/data.c
parent39cd87c4eb2b893354f3b850f916353f2658ae6f (diff)
erofs: switch erofs_bread() to passing offset instead of block number
Callers are happier that way, especially since we no longer need to play with splitting offset into block number and offset within block, passing the former to erofs_bread(), then adding the latter... erofs_bread() always reads entire pages, anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/erofs/data.c')
-rw-r--r--fs/erofs/data.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 52524bd9698b..d3c446dda2ff 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -29,11 +29,10 @@ void erofs_put_metabuf(struct erofs_buf *buf)
* Derive the block size from inode->i_blkbits to make compatible with
* anonymous inode in fscache mode.
*/
-void *erofs_bread(struct erofs_buf *buf, erofs_blk_t blkaddr,
+void *erofs_bread(struct erofs_buf *buf, erofs_off_t offset,
enum erofs_kmap_type type)
{
struct inode *inode = buf->inode;
- erofs_off_t offset = (erofs_off_t)blkaddr << inode->i_blkbits;
pgoff_t index = offset >> PAGE_SHIFT;
struct page *page = buf->page;
struct folio *folio;
@@ -77,7 +76,7 @@ void *erofs_read_metabuf(struct erofs_buf *buf, struct super_block *sb,
erofs_blk_t blkaddr, enum erofs_kmap_type type)
{
erofs_init_metabuf(buf, sb);
- return erofs_bread(buf, blkaddr, type);
+ return erofs_bread(buf, erofs_pos(sb, blkaddr), type);
}
static int erofs_map_blocks_flatmode(struct inode *inode,