[PATCH 5/6] ceph: convert r_locked_page to r_locked_folio
From: Tal Zussman
Date: Tue Aug 25 2026 - 17:49:58 EST
Pass a folio through the inline data plumbing: __ceph_do_getattr(),
struct ceph_mds_request, and ceph_fill_inode(). No callers pass a page
anymore, so this removes the &folio->page conversions in the fault and
READ_INLINE paths and the page_folio() call in ceph_fill_inode().
Remove externs from function declarations while at it.
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/ceph/addr.c | 2 +-
fs/ceph/file.c | 3 +--
fs/ceph/inode.c | 15 +++++++--------
fs/ceph/mds_client.h | 2 +-
fs/ceph/super.h | 6 +++---
5 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 2ff90b891fc9..95e889020db7 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -2064,7 +2064,7 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
ret = VM_FAULT_OOM;
goto out_inline;
}
- err = __ceph_do_getattr(inode, &folio->page,
+ err = __ceph_do_getattr(inode, folio,
CEPH_STAT_CAP_INLINE_DATA, true);
if (err < 0 || off >= i_size_read(inode)) {
folio_unlock(folio);
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 592e32d1e2d4..0b6921293f27 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2275,8 +2275,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)
mask = CEPH_STAT_CAP_INLINE_DATA;
}
- statret = __ceph_do_getattr(inode, folio ? &folio->page : NULL,
- mask, !!folio);
+ statret = __ceph_do_getattr(inode, folio, mask, !!folio);
if (statret < 0) {
if (folio)
folio_put(folio);
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index b91125567cf0..0876752c90dd 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1010,7 +1010,7 @@ static int decode_encrypted_symlink(struct ceph_mds_client *mdsc,
* Populate an inode based on info from mds. May be called on new or
* existing inodes.
*/
-int ceph_fill_inode(struct inode *inode, struct page *locked_page,
+int ceph_fill_inode(struct inode *inode, struct folio *locked_folio,
struct ceph_mds_reply_info_in *iinfo,
struct ceph_mds_reply_dirfrag *dirinfo,
struct ceph_mds_session *session, int cap_fmode,
@@ -1367,7 +1367,7 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page,
int cache_caps = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO;
ci->i_inline_version = iinfo->inline_version;
if (ceph_has_inline_data(ci) &&
- (locked_page || (info_caps & cache_caps)))
+ (locked_folio || (info_caps & cache_caps)))
fill_inline = true;
}
@@ -1383,8 +1383,7 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page,
ceph_fscache_register_inode_cookie(inode);
if (fill_inline)
- ceph_fill_inline_data(inode,
- locked_page ? page_folio(locked_page) : NULL,
+ ceph_fill_inline_data(inode, locked_folio,
iinfo->inline_data, iinfo->inline_len);
if (wake)
@@ -1714,7 +1713,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
in = req->r_target_inode;
ceph_inode_set_subvolume(in, rinfo->targeti.subvolume_id);
- err = ceph_fill_inode(in, req->r_locked_page, &rinfo->targeti,
+ err = ceph_fill_inode(in, req->r_locked_folio, &rinfo->targeti,
NULL, session,
(!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) &&
!test_bit(CEPH_MDS_R_ASYNC, &req->r_req_flags) &&
@@ -2993,7 +2992,7 @@ int ceph_try_to_choose_auth_mds(struct inode *inode, int mask)
* Verify that we have a lease on the given mask. If not,
* do a getattr against an mds.
*/
-int __ceph_do_getattr(struct inode *inode, struct page *locked_page,
+int __ceph_do_getattr(struct inode *inode, struct folio *locked_folio,
int mask, bool force)
{
struct ceph_fs_client *fsc = ceph_sb_to_fs_client(inode->i_sb);
@@ -3022,9 +3021,9 @@ int __ceph_do_getattr(struct inode *inode, struct page *locked_page,
ihold(inode);
req->r_num_caps = 1;
req->r_args.getattr.mask = cpu_to_le32(mask);
- req->r_locked_page = locked_page;
+ req->r_locked_folio = locked_folio;
err = ceph_mdsc_do_request(mdsc, NULL, req);
- if (locked_page && err == 0) {
+ if (locked_folio && err == 0) {
u64 inline_version = req->r_reply_info.targeti.inline_version;
if (inline_version == 0) {
/* the reply is supposed to contain inline data */
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index 3c62e3c3530b..c0c72a41ef46 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -398,7 +398,7 @@ struct ceph_mds_request {
int r_err;
u32 r_readdir_offset;
- struct page *r_locked_page;
+ struct folio *r_locked_folio;
int r_dir_caps;
int r_num_caps;
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 30e625e02398..6df62b51a6a4 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -1120,7 +1120,7 @@ extern void ceph_fill_file_time(struct inode *inode, int issued,
u64 time_warp_seq, struct timespec64 *ctime,
struct timespec64 *mtime,
struct timespec64 *atime);
-extern int ceph_fill_inode(struct inode *inode, struct page *locked_page,
+int ceph_fill_inode(struct inode *inode, struct folio *locked_folio,
struct ceph_mds_reply_info_in *iinfo,
struct ceph_mds_reply_dirfrag *dirinfo,
struct ceph_mds_session *session, int cap_fmode,
@@ -1161,8 +1161,8 @@ static inline void ceph_queue_flush_snaps(struct inode *inode)
}
extern int ceph_try_to_choose_auth_mds(struct inode *inode, int mask);
-extern int __ceph_do_getattr(struct inode *inode, struct page *locked_page,
- int mask, bool force);
+int __ceph_do_getattr(struct inode *inode, struct folio *locked_folio,
+ int mask, bool force);
static inline int ceph_do_getattr(struct inode *inode, int mask, bool force)
{
return __ceph_do_getattr(inode, NULL, mask, force);
--
2.39.5