From 0f996eb77ea9bece3f609b1e1238b43e1cc14e0c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 17 Mar 2023 15:37:34 -0400 Subject: bcachefs: More folio conversion Signed-off-by: Kent Overstreet --- fs/bcachefs/fs-io.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 78a02d3bd173..b95b91fd19ca 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -3511,12 +3511,10 @@ static loff_t bch2_seek_pagecache_data(struct inode *vinode, folio_lock(folio); offset = folio_data_offset(folio, - folio->index == start_index - ? start_offset & (PAGE_SIZE - 1) - : 0); + max(folio_pos(folio), start_offset) - + folio_pos(folio)); if (offset >= 0) { - ret = clamp(((loff_t) folio->index << PAGE_SHIFT) + - offset, + ret = clamp(folio_pos(folio) + offset, start_offset, end_offset); folio_unlock(folio); folio_batch_release(&fbatch); -- cgit v1.2.3