From 19040032347870ec069f9db67d097d69383a9ee2 Mon Sep 17 00:00:00 2001 From: Tal Zussman Date: Wed, 2 Sep 2026 12:35:11 -0400 Subject: [PATCH] ceph: convert r_locked_page to r_locked_folio 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 Reviewed-by: Alex Markuze Signed-off-by: Ilya Dryomov --- 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 e43b3a1f6133..e6d62f711db8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -2068,7 +2068,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 f0e77a1ab4d1..7ec5d3192974 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2258,8 +2258,7 @@ again: 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 4cb703e307b0..28276d818a6a 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1078,7 +1078,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, @@ -1435,7 +1435,7 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page, int cache_caps = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO; ceph_set_inline_version(ci, iinfo->inline_version); if (ceph_has_inline_data(ci) && - (locked_page || (info_caps & cache_caps))) + (locked_folio || (info_caps & cache_caps))) fill_inline = true; } @@ -1451,8 +1451,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) @@ -1782,7 +1781,7 @@ retry_lookup: 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) && @@ -3061,7 +3060,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); @@ -3090,9 +3089,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 e7a262c9c2ab..d4d620fb8417 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 16a13529d0aa..2720e4176106 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1152,7 +1152,7 @@ extern void ceph_fill_file_time(struct inode *inode, int issued, u32 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, @@ -1193,8 +1193,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);