From patchwork Thu Sep 5 16:30:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 2854179 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 1CE439F499 for ; Thu, 5 Sep 2013 16:31:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E501820360 for ; Thu, 5 Sep 2013 16:31:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2BCF20166 for ; Thu, 5 Sep 2013 16:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752725Ab3IEQac (ORCPT ); Thu, 5 Sep 2013 12:30:32 -0400 Received: from fieldses.org ([174.143.236.118]:40827 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752662Ab3IEQaa (ORCPT ); Thu, 5 Sep 2013 12:30:30 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1VHcRs-0005zx-DY; Thu, 05 Sep 2013 12:30:25 -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 02/12] vfs: don't use PARENT/CHILD lock classes for non-directories Date: Thu, 5 Sep 2013 12:30:08 -0400 Message-Id: <1378398620-23018-5-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1378398620-23018-1-git-send-email-bfields@redhat.com> References: <1378398620-23018-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=-9.3 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" 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.) Acked-by: Jeff Layton 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 57d273e..f642102 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -995,11 +995,11 @@ void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) } WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); 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);