Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbcDPDbY (ORCPT ); Fri, 15 Apr 2016 23:31:24 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:40279 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbcDPDbW (ORCPT ); Fri, 15 Apr 2016 23:31:22 -0400 Date: Sat, 16 Apr 2016 04:31:16 +0100 From: Al Viro To: Andreas Dilger Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 15/15] parallel lookups: actual switch to rwsem Message-ID: <20160416033116.GX25498@ZenIV.linux.org.uk> References: <20160416005232.GV25498@ZenIV.linux.org.uk> <1460768127-31822-15-git-send-email-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 13 On Fri, Apr 15, 2016 at 09:02:06PM -0600, Andreas Dilger wrote: > Wouldn't it make sense to have helpers like "inode_read_lock(inode)" or similar, > so that it is consistent with other parts of the code and easier to find? > It's a bit strange to have the filesystems use "inode_lock()" and some places > here use "inode_lock_nested()", but other places use up_read() and down_read() > directly on &inode->i_rwsem. That would also simplify delegating the directory > locking to the filesystems in the future. FWIW, my preference would be inode_lock_shared(), but that's bikeshedding; seeing that we have very few callers at the moment *and* there's the missing down_write_killable() stuff... This patch will obviously be reworked and it's small enough to be understandable, open-coding or not.