diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-17 15:37:34 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-19 16:49:55 -0400 |
commit | 0f996eb77ea9bece3f609b1e1238b43e1cc14e0c (patch) | |
tree | b10163cdb667e46883cc32d5c3523343a2752cb4 | |
parent | b9b065953615fe9772375fe21d64dbbd80c143c3 (diff) |
bcachefs: More folio conversion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/fs-io.c | 8 |
1 files 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); |