[PATCH 1/6] ceph: use a folio in ceph_get_caps()
From: Tal Zussman
Date: Tue Aug 25 2026 - 17:50:03 EST
Convert the inline data page cache check to filemap_get_folio(), which
returns an ERR_PTR instead of NULL when no folio is present. Saves two
calls to compound_head().
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/ceph/caps.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 6466e11ca783..af2aa098f553 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3250,12 +3250,12 @@ int __ceph_get_caps(struct inode *inode, struct ceph_file_info *fi, int need,
ceph_has_inline_data(ci) &&
(_got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) &&
i_size_read(inode) > 0) {
- struct page *page =
- find_get_page(inode->i_mapping, 0);
- if (page) {
- bool uptodate = PageUptodate(page);
+ struct folio *folio =
+ filemap_get_folio(inode->i_mapping, 0);
+ if (!IS_ERR(folio)) {
+ bool uptodate = folio_test_uptodate(folio);
- put_page(page);
+ folio_put(folio);
if (uptodate)
break;
}
--
2.39.5