Re: [PATCH 4/4] ceph: remove page_snap_context()

Tal Zussman <[email protected]> Mon, 3 Aug 2026 14:03:37 +0300
Newsgroups org.kernel.vger.ceph-devel,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 8/2/26 10:06 PM, Matthew Wilcox wrote: 
> On Sun, Aug 02, 2026 at 12:50:05PM -0400, Tal Zussman wrote:
>> Convert the final caller in get_writepages_data_length() to use a folio
>> and ceph_folio_snap_context(), then remove page_snap_context().
>> 
>> This drops the last open-coded use of page->private in ceph's writeback
>> path.
> 
> This one I'm deeply conflicted about.  It's adding an extra call to
> compound_head() ... and we're not getting much for it.
> 
> I'd feel better about it if it started with::
> 
>   static u64 get_writepages_data_length(struct inode *inode,
>                                         struct page *page, u64 start)
>   {
> +	struct folio *folio = page_folio(page);
> 
> and then we had a ceph_fscrypt_pagecache_folio() function and
> ceph_fscrypt_folio_offset() (we already have a fscrypt_is_bounce_page())

If we're adding these, I might as well do a few more conversions...

> That way we'd have this function entirely converted except for its
> argument, and a future patch can do the conversion with little fuss.
> And we'd get rid of one of the four remaining calls to
> fscrypt_is_bounce_page()

I'm tempted to convert the argument as well, offload the page_folio
to the single caller (ceph_submit_write), and be done with this function
in one go. Although now that I look at it again, ceph_submit_write can
also be converted with the fscrypt helpers (albeit with a healthy dose
of page_folio() due to ceph's pages arrays...).