From patchwork Wed Apr 17 01:46:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 2452161 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 5FD03DF230 for ; Wed, 17 Apr 2013 01:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936154Ab3DQBqe (ORCPT ); Tue, 16 Apr 2013 21:46:34 -0400 Received: from fieldses.org ([174.143.236.118]:36524 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936023Ab3DQBqe (ORCPT ); Tue, 16 Apr 2013 21:46:34 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1USHSB-0002gz-AJ; Tue, 16 Apr 2013 21:46:31 -0400 From: "J. Bruce Fields" To: Al Viro Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , "J. Bruce Fields" Subject: [PATCH 02/12] vfs: don't use PARENT/CHILD lock classes for non-directories Date: Tue, 16 Apr 2013 21:46:14 -0400 Message-Id: <1366163185-10317-3-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366163185-10317-1-git-send-email-bfields@redhat.com> References: <1366163185-10317-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 9815712..07af7be 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -987,11 +987,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);