From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Josef 'Jeff' Sipek" Subject: [PATCH 04/13] fs/unionfs/: Several small cleanups in unionfs_interpose Date: Sun, 4 Mar 2007 21:16:48 -0500 Message-ID: <1173061017375-git-send-email-jsipek@cs.sunysb.edu> References: <11730610174005-git-send-email-jsipek@cs.sunysb.edu> Cc: "Josef 'Jeff' Sipek" To: linux-fsdevel@vger.kernel.org Return-path: Received: from filer.fsl.cs.sunysb.edu ([130.245.126.2]:39135 "EHLO filer.fsl.cs.sunysb.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbXCECRE (ORCPT ); Sun, 4 Mar 2007 21:17:04 -0500 In-Reply-To: <11730610174005-git-send-email-jsipek@cs.sunysb.edu> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 1) No need to lock the inode - lockdep was complaining about potential circular dependency 2) No need to use temporary variable for iunique() inode number 3) Removed unneeded comment Signed-off-by: Josef 'Jeff' Sipek --- fs/unionfs/main.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c index bd64242..a37916d 100644 --- a/fs/unionfs/main.c +++ b/fs/unionfs/main.c @@ -66,19 +66,14 @@ int unionfs_interpose(struct dentry *dentry, struct super_block *sb, int flag) err = -ENOMEM; goto out; } - mutex_lock(&inode->i_mutex); } else { - ino_t ino; /* get unique inode number for unionfs */ - ino = iunique(sb, UNIONFS_ROOT_INO); - - inode = iget(sb, ino); + inode = iget(sb, iunique(sb, UNIONFS_ROOT_INO)); if (!inode) { - err = -EACCES; /* should be impossible??? */ + err = -EACCES; goto out; } - mutex_lock(&inode->i_mutex); if (atomic_read(&inode->i_count) > 1) goto skip; } @@ -147,8 +142,6 @@ skip: BUG(); } - mutex_unlock(&inode->i_mutex); - out: return err; } -- 1.5.0.2.260.g2eb065