From nobody Sat Feb 7 06:55:53 2026 Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FFC6376BC5; Fri, 23 Jan 2026 01:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.222 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769132736; cv=none; b=nciitzSL/zN9Rlak+IgDUaodbEee8QHE09FyMJIuAbAVu1Z5mTnwv30R6sYepxAtiPHR4NL5CgVkQ4e+JFEeLCqloXGFDArlr2HzcuG5oLNzdTP4DJCEUtxhUmIXUnGi82VaKi25G6JEJeveUIBabW4WY1VzA/8UYoImEzsQ+x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769132736; c=relaxed/simple; bh=anA6yDKzxBNODzduD70HgdLsrJbw6S9AkfSIJUGFzX0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nCj76lmZYbGiikKLgQtPFQ3tWB24TT8NQpSA+MqbVPw93T3n6n/CmyDI4tSEyV/kepxeaKfW8y7G0de8uQHenvOiosOma+wkzEbnSAWvZrDHolCCfoYoitzqSmAeUt4yjTSM72/orF4R1ASOk6gmXvf4dtrg12+Wxf8DCYPSBgg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=uTFxrd8I; arc=none smtp.client-ip=113.46.200.222 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="uTFxrd8I" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=pjdMVj5WK0KjkehQa5OTHZ+MCiwfMCyVPXQRCDg124Y=; b=uTFxrd8IXGqAsUVgSzf8YOFirRCl+3Vri/JQVcixI0RqRwASzkKo/jUAAOd1zf2p8vAHRhNct 7JRO2KnDibrXmcR1YSb58tPaTU2XzWY8irks5vvRwYuE1ugRbA9HdzpSp+Pa/6cphzU/dMAJn2U JzHDdXLMT0jGr7lSzjEguOw= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4dy0z93hBczLlTR; Fri, 23 Jan 2026 09:41:57 +0800 (CST) Received: from kwepemr500015.china.huawei.com (unknown [7.202.195.162]) by mail.maildlp.com (Postfix) with ESMTPS id 9F0384055B; Fri, 23 Jan 2026 09:45:21 +0800 (CST) Received: from huawei.com (10.67.174.162) by kwepemr500015.china.huawei.com (7.202.195.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 23 Jan 2026 09:45:20 +0800 From: Hongbo Li To: , , CC: , , , , , , Subject: [PATCH v18 10/10] erofs: implement .fadvise for page cache share Date: Fri, 23 Jan 2026 01:31:32 +0000 Message-ID: <20260123013132.662393-11-lihongbo22@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20260123013132.662393-1-lihongbo22@huawei.com> References: <20260123013132.662393-1-lihongbo22@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemr500015.china.huawei.com (7.202.195.162) Content-Type: text/plain; charset="utf-8" From: Hongzhen Luo This patch implements the .fadvise interface for page cache share. Similar to overlayfs, it drops those clean, unused pages through vfs_fadvise(). Signed-off-by: Hongzhen Luo Signed-off-by: Hongbo Li Reviewed-by: Gao Xiang --- fs/erofs/ishare.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/erofs/ishare.c b/fs/erofs/ishare.c index ad53a57dbcbc..ce980320a8b9 100644 --- a/fs/erofs/ishare.c +++ b/fs/erofs/ishare.c @@ -151,6 +151,12 @@ static int erofs_ishare_mmap(struct file *file, struct= vm_area_struct *vma) return generic_file_readonly_mmap(file, vma); } =20 +static int erofs_ishare_fadvise(struct file *file, loff_t offset, + loff_t len, int advice) +{ + return vfs_fadvise(file->private_data, offset, len, advice); +} + const struct file_operations erofs_ishare_fops =3D { .open =3D erofs_ishare_file_open, .llseek =3D generic_file_llseek, @@ -159,6 +165,7 @@ const struct file_operations erofs_ishare_fops =3D { .release =3D erofs_ishare_file_release, .get_unmapped_area =3D thp_get_unmapped_area, .splice_read =3D filemap_splice_read, + .fadvise =3D erofs_ishare_fadvise, }; =20 struct inode *erofs_real_inode(struct inode *inode, bool *need_iput) --=20 2.22.0