From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Hongbo Li <lihongbo22@huawei.com>
Cc: djwong@kernel.org, amir73il@gmail.com, hch@lst.de,
linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org>,
Christian Brauner <brauner@kernel.org>
Subject: Re: [PATCH v14 07/10] erofs: introduce the page cache share feature
Date: Thu, 15 Jan 2026 09:43:48 +0800 [thread overview]
Message-ID: <2f378658-ec10-4091-9f8d-02b19351cd44@linux.alibaba.com> (raw)
In-Reply-To: <6ccc0f3f-56a5-4edb-a4c9-72d6e5090b7b@huawei.com>
On 2026/1/15 09:21, Hongbo Li wrote:
> Hi,Xiang
>
> On 2026/1/14 18:18, Gao Xiang wrote:
>>
>>
>> On 2026/1/9 18:28, Hongbo Li wrote:
>>> From: Hongzhen Luo <hongzhen@linux.alibaba.com>
>>>
> ...
>
>>> +
>>> +static int erofs_ishare_iget5_set(struct inode *inode, void *data)
>>> +{
>>> + struct erofs_inode *vi = EROFS_I(inode);
>>> +
>>> + vi->fingerprint = *(struct erofs_inode_fingerprint *)data;
>>> + INIT_LIST_HEAD(&vi->ishare_list);
>>> + spin_lock_init(&vi->ishare_lock);
>>> + return 0;
>>> +}
>>> +
>>> +bool erofs_ishare_fill_inode(struct inode *inode)
>>> +{
>>> + struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
>>> + struct erofs_inode *vi = EROFS_I(inode);
>>> + struct erofs_inode_fingerprint fp;
>>> + struct inode *sharedinode;
>>> + unsigned long hash;
>>> +
>>> + if (erofs_xattr_fill_inode_fingerprint(&fp, inode, sbi->domain_id))
>>> + return false;
>>> + hash = xxh32(fp.opaque, fp.size, 0);
>>> + sharedinode = iget5_locked(erofs_ishare_mnt->mnt_sb, hash,
>>> + erofs_ishare_iget5_eq, erofs_ishare_iget5_set,
>>> + &fp);
>>> + if (!sharedinode) {
>>> + kfree(fp.opaque);
>>> + return false;
>>> + }
>>> +
>>> + vi->sharedinode = sharedinode;
>>> + if (inode_state_read_once(sharedinode) & I_NEW) {
>>> + if (erofs_inode_is_data_compressed(vi->datalayout)) {
>>> + sharedinode->i_mapping->a_ops = &z_erofs_aops;
>>
>> It seems that it caused a build warning:
>> https://lore.kernel.org/r/202601130827.dHbGXL3Y-lkp@intel.com
>>
>>> + } else {
>>> + sharedinode->i_mapping->a_ops = &erofs_aops;
>>> +#ifdef CONFIG_EROFS_FS_BACKED_BY_FILE
>>> + if (erofs_is_fileio_mode(sbi))
>>> + sharedinode->i_mapping->a_ops = &erofs_fileio_aops;
>>> +#endif
>>> + }
>>
>> Can we introduce a new helper for those aops setting? such as:
>>
>> void erofs_inode_set_aops(struct erofs_inode *inode,
>> struct erofs_inode *realinode, bool no_fscache)
>
> Yeah, good idea. So it also can be reuse in erofs_fill_inode.
>
> And how about declearing it as "int erofs_iode_set_aops(struct erofs_inode *inode, struct erofs_inode *realinode, bool no_fscache)"; because the compressed case may return -EOPNOTSUPP and it seems we cannot break this in advance.
yes, `int` return is good.
> And can we mark it inline?
you could move this one to internal.h.
Thanks,
Gao Xiang
>
> Thanks,
> Hongbo
next prev parent reply other threads:[~2026-01-15 1:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 10:28 [PATCH v14 00/10] erofs: Introduce page cache sharing feature Hongbo Li
2026-01-09 10:28 ` [PATCH v14 01/10] iomap: stash iomap read ctx in the private field of iomap_iter Hongbo Li
2026-01-09 18:14 ` Darrick J. Wong
2026-01-10 11:55 ` Gao Xiang
2026-01-09 10:28 ` [PATCH v14 02/10] erofs: hold read context in iomap_iter if needed Hongbo Li
2026-01-09 10:28 ` [PATCH v14 03/10] fs: Export alloc_empty_backing_file Hongbo Li
2026-01-12 9:10 ` Christian Brauner
2026-01-09 10:28 ` [PATCH v14 04/10] erofs: decouple `struct erofs_anon_fs_type` Hongbo Li
2026-01-09 10:28 ` [PATCH v14 05/10] erofs: support user-defined fingerprint name Hongbo Li
2026-01-09 10:28 ` [PATCH v14 06/10] erofs: support domain-specific page cache share Hongbo Li
2026-01-09 10:28 ` [PATCH v14 07/10] erofs: introduce the page cache share feature Hongbo Li
2026-01-14 10:18 ` Gao Xiang
2026-01-15 1:21 ` Hongbo Li
2026-01-15 1:43 ` Gao Xiang [this message]
2026-01-09 10:28 ` [PATCH v14 08/10] erofs: support unencoded inodes for page cache share Hongbo Li
2026-01-14 14:51 ` Gao Xiang
2026-01-15 1:36 ` Hongbo Li
2026-01-15 1:46 ` Gao Xiang
2026-01-15 1:47 ` Hongbo Li
2026-01-09 10:28 ` [PATCH v14 09/10] erofs: support compressed " Hongbo Li
2026-01-14 14:53 ` Gao Xiang
2026-01-09 10:28 ` [PATCH v14 10/10] erofs: implement .fadvise " Hongbo Li
2026-01-12 9:14 ` [PATCH v14 00/10] erofs: Introduce page cache sharing feature Christian Brauner
2026-01-12 14:40 ` Gao Xiang
2026-01-14 10:28 ` Gao Xiang
2026-01-14 15:34 ` Christian Brauner
2026-01-14 15:33 ` (subset) " Christian Brauner
2026-01-14 15:35 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f378658-ec10-4091-9f8d-02b19351cd44@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=chao@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=lihongbo22@huawei.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®