From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98D45C433EF for ; Tue, 12 Apr 2022 14:37:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E73C6B0074; Tue, 12 Apr 2022 10:37:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16F336B007B; Tue, 12 Apr 2022 10:37:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 010B16B007E; Tue, 12 Apr 2022 10:37:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id DD3426B0074 for ; Tue, 12 Apr 2022 10:37:10 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8DCA4A0A11 for ; Tue, 12 Apr 2022 14:37:10 +0000 (UTC) X-FDA: 79348479420.27.91A0643 Received: from r3-19.sinamail.sina.com.cn (r3-19.sinamail.sina.com.cn [202.108.3.19]) by imf23.hostedemail.com (Postfix) with SMTP id 4F554140018 for ; Tue, 12 Apr 2022 14:37:07 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.249.57.134]) by sina.com (172.16.97.35) with ESMTP id 62558E88000217D4; Tue, 12 Apr 2022 22:36:58 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 73035815073898 From: Hillf Danton To: Chao Peng Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A . Shutemov" Subject: Re: [PATCH v5 02/13] mm: Introduce memfile_notifier Date: Tue, 12 Apr 2022 22:36:54 +0800 Message-Id: <20220412143654.6313-1-hdanton@sina.com> In-Reply-To: <20220310140911.50924-3-chao.p.peng@linux.intel.com> References: MIME-Version: 1.0 X-Stat-Signature: mwqp9y6sfs5fd79gnb61r73cw5keybrs Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.19 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 4F554140018 X-HE-Tag: 1649774227-562261 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000204, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 10 Mar 2022 22:09:00 +0800 Chao Peng wrote: > + > +void memfile_register_backing_store(struct memfile_backing_store *bs) > +{ > + BUG_ON(!bs || !bs->get_notifier_list); > + > + list_add_tail(&bs->list, &backing_store_list); > +} > + > +void memfile_unregister_backing_store(struct memfile_backing_store *bs= ) > +{ > + list_del(&bs->list); > +} > + > +static int memfile_get_notifier_info(struct inode *inode, Nit, s/get/lookup/ > + struct memfile_notifier_list **list, > + struct memfile_pfn_ops **ops) > +{ > + struct memfile_backing_store *bs, *iter; > + struct memfile_notifier_list *tmp; > + > + list_for_each_entry_safe(bs, iter, &backing_store_list, list) { Wonder what serializes list walk with list del and add above. > + tmp =3D bs->get_notifier_list(inode); > + if (tmp) { > + *list =3D tmp; > + if (ops) > + *ops =3D &bs->pfn_ops; > + return 0; > + } > + } > + return -EOPNOTSUPP; > +}