Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2149803ybc; Wed, 20 Nov 2019 09:35:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyEI8sah47NnDFty3rabHk+lhFpHbNFDxYsPHkKliQp3NfmLEe8gk2qU7wX24qnPT1H1tzG X-Received: by 2002:a17:906:b246:: with SMTP id ce6mr6482762ejb.298.1574271352308; Wed, 20 Nov 2019 09:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574271352; cv=none; d=google.com; s=arc-20160816; b=vjmL9d5bBQEGIO0Fq+QNGCvDBye9pZdrtt2t+K4UZAoisq73XEoHmWTgmU6d7i6SG/ kAaR5ACPT1leNt3BTEDVchE1kGiKmCoSfsUOzmSqSabTvQx0hZ04wI279G6XnljzOkpM Zc4aUyu2+wDPwHRv5ZFoED7B32GHZ8VpJ0HXwiOnc0+UECPngQ798AtXqeQrZSIqIVG0 IztqGc8ofJUAt2QQbphQsda8grY6vOBVmvZZ8OwupRBu5Os2QFVtCQ0LjWvoo//hKHcJ hX6dhlNHW9zB/FfO7Amid4kpMyU0YTHd/AjKf8lYS0ZxjCzdP2thqHIaUxnBIy8c9u9+ J+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MwZWupiSwoX5j5mENHy05kP0FGbIABMO7rM4iqDs5RY=; b=yag+GJGsmrUiMDkwOiS/n7EO3FrXc9/qMB/n3zZXRVVFMqZ8yTMbIHhd+aP7jVrQZP RYdfA1RJlybHaLqcO9j6NP8mc+HFmzAXfHAQa8u08FFeclkV1+dWQmmHIn/iku3SEzUn 7rLctnwTbm20Ix8AJErxGirxnQqKZfZ1iBS2A0L1Nw5We9fCKpMpxUAVV5Qh13FW44Oh ZDrKLC5I/PixNYhbwLJF6GQmz4DFktjHkAaBg8laoSuHlqLepYPnqk3szBuht2oSdMWK qjyb1QalVEiDu1jRGxbR6E5LWzXJLaPkekZ2uemoaOTREZEZ3zryQ2h4UFkhc9JFY7A8 LIsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XVaRzTww; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si3680420ejx.8.2019.11.20.09.35.22; Wed, 20 Nov 2019 09:35:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XVaRzTww; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbfKTQfE (ORCPT + 99 others); Wed, 20 Nov 2019 11:35:04 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:56024 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbfKTQfD (ORCPT ); Wed, 20 Nov 2019 11:35:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=MwZWupiSwoX5j5mENHy05kP0FGbIABMO7rM4iqDs5RY=; b=XVaRzTwwOoq7hudzEGLuX9k3n uM8sKqABcsa6w1yOIAcJlYjbOhm3N9xRVOONrS+BpL1E0nNPub1CHPbYvikVjKVF83gA0PuNYW90Y SioU9d2DR5GrA7wyoMguCWYjO5/6syitDEizuzVYliU2Thx7a0C6SLwpdJhY10UccagysVb9omnwz EgVfA7yhE0AItWgroaFPYha37/r1VmuPhnuwTt1OPVbVF9Vn6mOL8/C3/lmzgmBYqYgmkDVSgWTtr tE19NKad8yT5hYqoCtU3VyIAku1adrSVcLcT2DFWopP6LkGUnj6r9/aMEfUewbKFuBVB4U1sm5VDw oZXksys3A==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXSwW-0006Zw-IG; Wed, 20 Nov 2019 16:35:00 +0000 Date: Wed, 20 Nov 2019 08:35:00 -0800 From: Matthew Wilcox To: Ritesh Harjani Cc: Matthew Bobrowski , jack@suse.cz, tytso@mit.edu, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFCv3 2/4] ext4: Add ext4_ilock & ext4_iunlock API Message-ID: <20191120163500.GT20752@bombadil.infradead.org> References: <20191120050024.11161-1-riteshh@linux.ibm.com> <20191120050024.11161-3-riteshh@linux.ibm.com> <20191120112339.GB30486@bobrowski> <20191120121831.9639B42047@d06av24.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191120121831.9639B42047@d06av24.portsmouth.uk.ibm.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Nov 20, 2019 at 05:48:30PM +0530, Ritesh Harjani wrote: > Not against your suggestion here. > But in kernel I do see a preference towards object followed by a verb. > At least in vfs I see functions like inode_lock()/unlock(). > > Plus I would not deny that this naming is also inspired from > xfs_ilock()/iunlock API names. I see those names as being "classical Unix" heritage (eh, maybe SysV). > hmm, it was increasing the name of the macro if I do it that way. > But that's ok. Is below macro name better? > > #define EXT4_INODE_IOLOCK_EXCL (1 << 0) > #define EXT4_INODE_IOLOCK_SHARED (1 << 1) In particular, Linux tends to prefer read/write instead of shared/exclusive terminology. rwlocks, rwsems, rcu_read_lock, seqlocks. shared/exclusive is used by file locks. And XFS ;-) I agree with Jan; just leave them opencoded. Probably worth adding inode_lock_downgrade() to fs.h instead of accessing i_rwsem directly.