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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC862C47089 for ; Wed, 26 May 2021 15:25:35 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82348613D7; Wed, 26 May 2021 15:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82348613D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1llvPY-0001Bm-Iz; Wed, 26 May 2021 15:25:32 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llvPX-0001Bf-CQ for linux-f2fs-devel@lists.sourceforge.net; Wed, 26 May 2021 15:25:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yaK31paB4eVrRy7IeaGP9TvUAcIoqhXW6gG5tL/CumQ=; b=JPjqbXiMrnZC9G596W0eadFTnu lX0RoiA5WPlCVaXM9Hb8tOGlCJOJXsTTviZ7PbawrNUEFZlQ5dHFbAAJr0klfbn0YRR7QCfb+DOEg FZk2bWd2/l7+hyLJUIPZHLaspOJGRTRxhLlD7hHb804DH6adu1zOAGRIw2cj121vCx5E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yaK31paB4eVrRy7IeaGP9TvUAcIoqhXW6gG5tL/CumQ=; b=Kyqzqk2WgDeMRyagM7qNqjctey nwWTWW6WWOeMtr14wh6vCDmxZRX32GFQcUGhJUPbdx3arFRZR1vLNUhOHKb8up6CnjQAvEudMwPwE yaVTUI2VHjmuw0lbLFqa7XhGBijBE9hFpAhrVLmKiMTOKwCmldJ7AWLdVJxM+98Jd4WU=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1llvPV-0006qt-T8 for linux-f2fs-devel@lists.sourceforge.net; Wed, 26 May 2021 15:25:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8A6FB61378; Wed, 26 May 2021 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622042725; bh=/uzTTNLjF88gVIvVPehwcj9E7+SDKIBIEbe1++RMcCA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vQ7xuH3OSvQiH8WTyODIiNgCaa8VPSIlyo23vb9HtCWw7llMRo4A/QjKfRC588iEs cvBicODScd+zWU0/qy9HoNnaXPqGqeM7FPRW1d7eD3je2K9aXlvIXMfyoweXztaME1 I14haJq08cG54aoOyPVUR07m+a8Dp3PTJnGilKvamk99idXs9eZcznD7NKdNQgHXzw MCmHriw/JX66+IvWWdkHQ8tSWchzi7nZ3ymLuHxR3qrqa5nDnh77qs3pFVtTGrDfYH PdRj3qcJPIWztj+xrh/HZE/cXxl9nVGPOJbQzuoNKF2vnF6COWpAHtFpeZnx4It663 X4utnX24c9Niw== Date: Wed, 26 May 2021 08:25:25 -0700 From: "Darrick J. Wong" To: Jan Kara Message-ID: <20210526152525.GY202121@locust> References: <20210525125652.20457-1-jack@suse.cz> <20210525135100.11221-4-jack@suse.cz> <20210525204805.GM202121@locust> <20210526100702.GB30369@quack2.suse.cz> <20210526134518.GF30369@quack2.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210526134518.GF30369@quack2.suse.cz> X-Headers-End: 1llvPV-0006qt-T8 Subject: Re: [f2fs-dev] [PATCH 04/13] mm: Add functions to lock invalidate_lock for two mappings X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-cifs@vger.kernel.org" , Damien Le Moal , "linux-ext4@vger.kernel.org" , Ted Tso , "Darrick J. Wong" , Jeff Layton , Steve French , Dave Chinner , Matthew Wilcox , "linux-f2fs-devel@lists.sourceforge.net" , "hch@infradead.org" , "linux-mm@kvack.org" , Miklos Szeredi , "linux-fsdevel@vger.kernel.org" , Jaegeuk Kim , "ceph-devel@vger.kernel.org" , Johannes Thumshirn , "linux-xfs@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Wed, May 26, 2021 at 03:45:18PM +0200, Jan Kara wrote: > On Wed 26-05-21 12:11:43, Damien Le Moal wrote: > > On 2021/05/26 19:07, Jan Kara wrote: > > > On Tue 25-05-21 13:48:05, Darrick J. Wong wrote: > > >> On Tue, May 25, 2021 at 03:50:41PM +0200, Jan Kara wrote: > > >>> Some operations such as reflinking blocks among files will need to lock > > >>> invalidate_lock for two mappings. Add helper functions to do that. > > >>> > > >>> Signed-off-by: Jan Kara > > >>> --- > > >>> include/linux/fs.h | 6 ++++++ > > >>> mm/filemap.c | 38 ++++++++++++++++++++++++++++++++++++++ > > >>> 2 files changed, 44 insertions(+) > > >>> > > >>> diff --git a/include/linux/fs.h b/include/linux/fs.h > > >>> index 897238d9f1e0..e6f7447505f5 100644 > > >>> --- a/include/linux/fs.h > > >>> +++ b/include/linux/fs.h > > >>> @@ -822,6 +822,12 @@ static inline void inode_lock_shared_nested(struct inode *inode, unsigned subcla > > >>> void lock_two_nondirectories(struct inode *, struct inode*); > > >>> void unlock_two_nondirectories(struct inode *, struct inode*); > > >>> > > >>> +void filemap_invalidate_down_write_two(struct address_space *mapping1, > > >>> + struct address_space *mapping2); > > >>> +void filemap_invalidate_up_write_two(struct address_space *mapping1, > > >> > > >> TBH I find myself wishing that the invalidate_lock used the same > > >> lock/unlock style wrappers that we use for i_rwsem. > > >> > > >> filemap_invalidate_lock(inode1->mapping); > > >> filemap_invalidate_lock_two(inode1->i_mapping, inode2->i_mapping); > > > > > > OK, and filemap_invalidate_lock_shared() for down_read()? I guess that > > > works for me. > > > > What about filemap_invalidate_lock_read() and filemap_invalidate_lock_write() ? > > That reminds the down_read()/down_write() without the slightly confusing down/up. > > Well, if we go for lock wrappers as Darrick suggested, I'd mirror naming > used for inode_lock(). That is IMO the least confusing option... And that > naming has _lock and _lock_shared suffixes. I'd like filemap_invalidate_lock and filemap_invalidate_lock_shared. --D > > Honza > > -- > Jan Kara > SUSE Labs, CR _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel