[PATCH v3 6/9] ceph: Convert ceph_check_page_before_write() to use a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove the conversion back to a struct page and just use the folio
passed in.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
 fs/ceph/addr.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 871adfa82c1f..90d154bc4808 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1142,18 +1142,17 @@ int ceph_check_page_before_write(struct address_space *mapping,
 	struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
 	struct ceph_client *cl = fsc->client;
 	struct ceph_snap_context *pgsnapc;
-	struct page *page = &folio->page;
 
-	/* only dirty pages, or our accounting breaks */
-	if (unlikely(!PageDirty(page)) || unlikely(page->mapping != mapping)) {
-		doutc(cl, "!dirty or !mapping %p\n", page);
+	/* only dirty folios, or our accounting breaks */
+	if (unlikely(!folio_test_dirty(folio) || folio->mapping != mapping)) {
+		doutc(cl, "!dirty or !mapping %p\n", folio);
 		return -ENODATA;
 	}
 
 	/* only if matching snap context */
-	pgsnapc = page_snap_context(page);
+	pgsnapc = page_snap_context(&folio->page);
 	if (pgsnapc != ceph_wbc->snapc) {
-		doutc(cl, "page snapc %p %lld != oldest %p %lld\n",
+		doutc(cl, "folio snapc %p %lld != oldest %p %lld\n",
 		      pgsnapc, pgsnapc->seq,
 		      ceph_wbc->snapc, ceph_wbc->snapc->seq);
 
@@ -1164,7 +1163,7 @@ int ceph_check_page_before_write(struct address_space *mapping,
 		return -ENODATA;
 	}
 
-	if (page_offset(page) >= ceph_wbc->i_size) {
+	if (folio_pos(folio) >= ceph_wbc->i_size) {
 		doutc(cl, "folio at %lu beyond eof %llu\n",
 		      folio->index, ceph_wbc->i_size);
 
@@ -1177,8 +1176,8 @@ int ceph_check_page_before_write(struct address_space *mapping,
 	}
 
 	if (ceph_wbc->strip_unit_end &&
-	    (page->index > ceph_wbc->strip_unit_end)) {
-		doutc(cl, "end of strip unit %p\n", page);
+	    (folio->index > ceph_wbc->strip_unit_end)) {
+		doutc(cl, "end of strip unit %p\n", folio);
 		return -E2BIG;
 	}
 
-- 
2.47.2





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux