From patchwork Wed Sep 11 20:03:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 2874611 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 333A29F485 for ; Wed, 11 Sep 2013 20:04:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5A11202F9 for ; Wed, 11 Sep 2013 20:04:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDCAF20201 for ; Wed, 11 Sep 2013 20:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757048Ab3IKUDi (ORCPT ); Wed, 11 Sep 2013 16:03:38 -0400 Received: from fieldses.org ([174.143.236.118]:45450 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757030Ab3IKUDW (ORCPT ); Wed, 11 Sep 2013 16:03:22 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1VJqdF-0000Ic-Lb; Wed, 11 Sep 2013 16:03:21 -0400 From: "J. Bruce Fields" To: Al Viro Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, jlayton@redhat.com, Dave Chinner , "J. Bruce Fields" Subject: [PATCH 03/13] vfs: rename I_MUTEX_QUOTA now that it's not used for quotas Date: Wed, 11 Sep 2013 16:03:09 -0400 Message-Id: <1378929799-1110-4-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1378929799-1110-1-git-send-email-bfields@redhat.com> References: <1378929799-1110-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" I_MUTEX_QUOTA is now just being used whenever we want to lock two non-directories. So the name isn't right. I_MUTEX_NONDIR2 isn't especially elegant but it's the best I could think of. Also fix some outdated documentation. Acked-by: Jeff Layton Signed-off-by: J. Bruce Fields --- fs/inode.c | 4 ++-- include/linux/fs.h | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 9f50a7e..2cd4ca5 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -996,10 +996,10 @@ void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); if (inode1 < inode2) { mutex_lock(&inode1->i_mutex); - mutex_lock_nested(&inode2->i_mutex, I_MUTEX_QUOTA); + mutex_lock_nested(&inode2->i_mutex, I_MUTEX_NONDIR2); } else { mutex_lock(&inode2->i_mutex); - mutex_lock_nested(&inode1->i_mutex, I_MUTEX_QUOTA); + mutex_lock_nested(&inode1->i_mutex, I_MUTEX_NONDIR2); } } EXPORT_SYMBOL(lock_two_nondirectories); diff --git a/include/linux/fs.h b/include/linux/fs.h index 1b9fedd..8b9dcbf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -622,10 +622,13 @@ static inline int inode_unhashed(struct inode *inode) * 0: the object of the current VFS operation * 1: parent * 2: child/target - * 3: quota file + * 3: xattr + * 4: second non-directory + * The last is for certain operations (such as rename) which lock two + * non-directories at once. * * The locking order between these classes is - * parent -> child -> normal -> xattr -> quota + * parent -> child -> normal -> xattr -> second non-directory */ enum inode_i_mutex_lock_class { @@ -633,7 +636,7 @@ enum inode_i_mutex_lock_class I_MUTEX_PARENT, I_MUTEX_CHILD, I_MUTEX_XATTR, - I_MUTEX_QUOTA + I_MUTEX_NONDIR2 }; void lock_two_nondirectories(struct inode *, struct inode*);