Skip to content

Commit fd15ba4

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
ceph: Remove call to PagePrivate2()
Use the folio that we already have to call folio_test_private_2() instead. This is the last call to PagePrivate2(), so replace its PAGEFLAG() definition with FOLIO_FLAG(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent a6752a6 commit fd15ba4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

fs/ceph/addr.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,9 @@ static int ceph_writepages_start(struct address_space *mapping,
10511051
if (!nr_folios && !locked_pages)
10521052
break;
10531053
for (i = 0; i < nr_folios && locked_pages < max_pages; i++) {
1054-
page = &fbatch.folios[i]->page;
1054+
struct folio *folio = fbatch.folios[i];
1055+
1056+
page = &folio->page;
10551057
doutc(cl, "? %p idx %lu\n", page, page->index);
10561058
if (locked_pages == 0)
10571059
lock_page(page); /* first page */
@@ -1078,8 +1080,6 @@ static int ceph_writepages_start(struct address_space *mapping,
10781080
continue;
10791081
}
10801082
if (page_offset(page) >= ceph_wbc.i_size) {
1081-
struct folio *folio = page_folio(page);
1082-
10831083
doutc(cl, "folio at %lu beyond eof %llu\n",
10841084
folio->index, ceph_wbc.i_size);
10851085
if ((ceph_wbc.size_stable ||
@@ -1095,16 +1095,16 @@ static int ceph_writepages_start(struct address_space *mapping,
10951095
unlock_page(page);
10961096
break;
10971097
}
1098-
if (PageWriteback(page) ||
1099-
PagePrivate2(page) /* [DEPRECATED] */) {
1098+
if (folio_test_writeback(folio) ||
1099+
folio_test_private_2(folio) /* [DEPRECATED] */) {
11001100
if (wbc->sync_mode == WB_SYNC_NONE) {
1101-
doutc(cl, "%p under writeback\n", page);
1102-
unlock_page(page);
1101+
doutc(cl, "%p under writeback\n", folio);
1102+
folio_unlock(folio);
11031103
continue;
11041104
}
1105-
doutc(cl, "waiting on writeback %p\n", page);
1106-
wait_on_page_writeback(page);
1107-
folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */
1105+
doutc(cl, "waiting on writeback %p\n", folio);
1106+
folio_wait_writeback(folio);
1107+
folio_wait_private_2(folio); /* [DEPRECATED] */
11081108
}
11091109

11101110
if (!clear_page_dirty_for_io(page)) {

include/linux/page-flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE)
543543
* - PG_private and PG_private_2 cause release_folio() and co to be invoked
544544
*/
545545
PAGEFLAG(Private, private, PF_ANY)
546-
PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY)
546+
FOLIO_FLAG(private_2, FOLIO_HEAD_PAGE)
547547

548548
/* owner_2 can be set on tail pages for anon memory */
549549
FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE)

0 commit comments

Comments
 (0)