Re: [PATCH 1/4] ceph: add ceph_folio_snap_context()

Tal Zussman <[email protected]>
Newsgroups gmane.linux.file-systems,gmane.comp.file-systems.ceph.devel,gmane.linux.kernel,gmane.linux.kernel.mm
Message-ID <[email protected]>
On 8/2/26 6:44 PM, Zi Yan wrote:
> On Sun Aug 2, 2026 at 5:52 PM EDT, Matthew Wilcox wrote:
>> On Sun, Aug 02, 2026 at 12:50:02PM -0400, Tal Zussman wrote:
>>> +static inline struct ceph_snap_context *ceph_folio_snap_context(struct folio *folio)
>>> +{
>>> +	if (folio_test_private(folio))
>>> +		return (void *)folio->private;
>>> +	return NULL;
>>> +}
>>
>> Filesystem folios _ought_to have folio->private as NULL when PG_private
>> is unset and PG_private set when folio->private is non-NULL.  Now, ceph
>> could be doing something Bad (I believe hugetlbfs does not honour this
>> for various reasons), but it looks like it's using
>> folio_attach_private() / folio_detach_private() appropriately.
>>
>> So I think we should just do:
>>
>> static inline
>> struct ceph_snap_context *ceph_folio_snap_context(const struct folio *folio)
>> {
>> 	return folio->private;
>> }
> 
> Yes, please. So I do not need to handle another exceptional user when I
> am trying to remove PG_private[1].
> 

Sounds good, will do.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.