summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-02-17 18:51:17 +0000
committerChristian Brauner <brauner@kernel.org>2025-02-28 11:21:31 +0100
commitd1b452673af4e5b3fc211d1344288abcbefb4fac (patch)
treeccca5eae5ecb7d6a25634374fdd3174cfbaa0a2e
parentad49fe2b3d54fe657756e1dbf0acb5ed9cf5c576 (diff)
ceph: Pass a folio to ceph_allocate_page_array()
Remove two accesses to page->index. Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org> Link: https://lore.kernel.org/r/20250217185119.430193-10-willy@infradead.org Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ceph/addr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 13f4fdd9a8ba..19efba28e461 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1191,7 +1191,7 @@ void __ceph_allocate_page_array(struct ceph_writeback_ctl *ceph_wbc,
static inline
void ceph_allocate_page_array(struct address_space *mapping,
struct ceph_writeback_ctl *ceph_wbc,
- struct page *page)
+ struct folio *folio)
{
struct inode *inode = mapping->host;
struct ceph_inode_info *ci = ceph_inode(inode);
@@ -1200,13 +1200,13 @@ void ceph_allocate_page_array(struct address_space *mapping,
u32 xlen;
/* prepare async write request */
- ceph_wbc->offset = (u64)page_offset(page);
+ ceph_wbc->offset = (u64)folio_pos(folio);
ceph_calc_file_object_mapping(&ci->i_layout,
ceph_wbc->offset, ceph_wbc->wsize,
&objnum, &objoff, &xlen);
ceph_wbc->num_ops = 1;
- ceph_wbc->strip_unit_end = page->index + ((xlen - 1) >> PAGE_SHIFT);
+ ceph_wbc->strip_unit_end = folio->index + ((xlen - 1) >> PAGE_SHIFT);
BUG_ON(ceph_wbc->pages);
ceph_wbc->max_pages = calc_pages_for(0, (u64)xlen);
@@ -1338,7 +1338,7 @@ int ceph_process_folio_batch(struct address_space *mapping,
* allocate a page array
*/
if (ceph_wbc->locked_pages == 0) {
- ceph_allocate_page_array(mapping, ceph_wbc, &folio->page);
+ ceph_allocate_page_array(mapping, ceph_wbc, folio);
} else if (!is_folio_index_contiguous(ceph_wbc, folio)) {
if (is_num_ops_too_big(ceph_wbc)) {
folio_redirty_for_writepage(wbc, folio);