From patchwork Tue Oct 16 22:01:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 1602651 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 55CEADFFED for ; Tue, 16 Oct 2012 22:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755344Ab2JPWBp (ORCPT ); Tue, 16 Oct 2012 18:01:45 -0400 Received: from fieldses.org ([174.143.236.118]:36007 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754728Ab2JPWBn (ORCPT ); Tue, 16 Oct 2012 18:01:43 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1TOFCn-00071T-IT; Tue, 16 Oct 2012 18:01:41 -0400 From: "J. Bruce Fields" To: Al Viro Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, "J. Bruce Fields" Subject: [PATCH 02/12] vfs: don't use PARENT/CHILD lock classes for non-directories Date: Tue, 16 Oct 2012 18:01:27 -0400 Message-Id: <1350424897-26894-3-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350424897-26894-1-git-send-email-bfields@redhat.com> References: <1350424897-26894-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 From: "J. Bruce Fields" Reserve I_MUTEX_PARENT and I_MUTEX_CHILD for locking of actual directories. (Also I_MUTEX_QUOTA isn't really a meaningful name for this locking class any more; fixed in a later patch.) Signed-off-by: J. Bruce Fields --- fs/inode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 9d5b6bd..413b043 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -976,11 +976,11 @@ EXPORT_SYMBOL(unlock_new_inode); void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) { if (inode1 < inode2) { - mutex_lock_nested(&inode1->i_mutex, I_MUTEX_PARENT); - mutex_lock_nested(&inode2->i_mutex, I_MUTEX_CHILD); + mutex_lock(&inode1->i_mutex); + mutex_lock_nested(&inode2->i_mutex, I_MUTEX_QUOTA); } else { - mutex_lock_nested(&inode2->i_mutex, I_MUTEX_PARENT); - mutex_lock_nested(&inode1->i_mutex, I_MUTEX_CHILD); + mutex_lock(&inode2->i_mutex); + mutex_lock_nested(&inode1->i_mutex, I_MUTEX_QUOTA); } } EXPORT_SYMBOL(lock_two_nondirectories);