Skip to content

Commit d1b4526

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
ceph: Pass a folio to ceph_allocate_page_array()
Remove two accesses to page->index. Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Viacheslav Dubeyko <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent ad49fe2 commit d1b4526

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/ceph/addr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ void __ceph_allocate_page_array(struct ceph_writeback_ctl *ceph_wbc,
11911191
static inline
11921192
void ceph_allocate_page_array(struct address_space *mapping,
11931193
struct ceph_writeback_ctl *ceph_wbc,
1194-
struct page *page)
1194+
struct folio *folio)
11951195
{
11961196
struct inode *inode = mapping->host;
11971197
struct ceph_inode_info *ci = ceph_inode(inode);
@@ -1200,13 +1200,13 @@ void ceph_allocate_page_array(struct address_space *mapping,
12001200
u32 xlen;
12011201

12021202
/* prepare async write request */
1203-
ceph_wbc->offset = (u64)page_offset(page);
1203+
ceph_wbc->offset = (u64)folio_pos(folio);
12041204
ceph_calc_file_object_mapping(&ci->i_layout,
12051205
ceph_wbc->offset, ceph_wbc->wsize,
12061206
&objnum, &objoff, &xlen);
12071207

12081208
ceph_wbc->num_ops = 1;
1209-
ceph_wbc->strip_unit_end = page->index + ((xlen - 1) >> PAGE_SHIFT);
1209+
ceph_wbc->strip_unit_end = folio->index + ((xlen - 1) >> PAGE_SHIFT);
12101210

12111211
BUG_ON(ceph_wbc->pages);
12121212
ceph_wbc->max_pages = calc_pages_for(0, (u64)xlen);
@@ -1338,7 +1338,7 @@ int ceph_process_folio_batch(struct address_space *mapping,
13381338
* allocate a page array
13391339
*/
13401340
if (ceph_wbc->locked_pages == 0) {
1341-
ceph_allocate_page_array(mapping, ceph_wbc, &folio->page);
1341+
ceph_allocate_page_array(mapping, ceph_wbc, folio);
13421342
} else if (!is_folio_index_contiguous(ceph_wbc, folio)) {
13431343
if (is_num_ops_too_big(ceph_wbc)) {
13441344
folio_redirty_for_writepage(wbc, folio);

0 commit comments

Comments
 (0)