From: jblunck@suse.de
To: Arnd Bergmann <arndb@de.ibm.com>
Cc: Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: [patch 1/2] spufs: make dentry reference count and locking symmetric
Date: Tue, 05 May 2009 23:32:04 +0200 [thread overview]
Message-ID: <20090505214433.946117208@suse.de> (raw)
In-Reply-To: 20090505213203.797397821@suse.de
[-- Attachment #1: spufs-make-dput-and-locking-symmetric.diff --]
[-- Type: text/plain, Size: 1753 bytes --]
This patch moves the dput() and the parent inode locking to the same function.
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
arch/powerpc/platforms/cell/spufs/inode.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
Index: b/arch/powerpc/platforms/cell/spufs/inode.c
===================================================================
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -450,16 +450,16 @@ spufs_create_context(struct inode *inode
ret = -EPERM;
if ((flags & SPU_CREATE_NOSCHED) &&
!capable(CAP_SYS_NICE))
- goto out_unlock;
+ goto out;
ret = -EINVAL;
if ((flags & (SPU_CREATE_NOSCHED | SPU_CREATE_ISOLATE))
== SPU_CREATE_ISOLATE)
- goto out_unlock;
+ goto out;
ret = -ENODEV;
if ((flags & SPU_CREATE_ISOLATE) && !isolated_loader)
- goto out_unlock;
+ goto out;
gang = NULL;
neighbor = NULL;
@@ -468,7 +468,7 @@ spufs_create_context(struct inode *inode
gang = SPUFS_I(inode)->i_gang;
ret = -EINVAL;
if (!gang)
- goto out_unlock;
+ goto out;
mutex_lock(&gang->aff_mutex);
neighbor = spufs_assert_affinity(flags, gang, aff_filp);
if (IS_ERR(neighbor)) {
@@ -505,10 +505,7 @@ spufs_create_context(struct inode *inode
out_aff_unlock:
if (affinity)
mutex_unlock(&gang->aff_mutex);
-out_unlock:
- mutex_unlock(&inode->i_mutex);
out:
- dput(dentry);
return ret;
}
@@ -595,8 +592,6 @@ static int spufs_create_gang(struct inod
}
out:
- mutex_unlock(&inode->i_mutex);
- dput(dentry);
return ret;
}
@@ -645,7 +640,6 @@ long spufs_create(struct nameidata *nd,
filp);
if (ret >= 0)
fsnotify_mkdir(nd->path.dentry->d_inode, dentry);
- return ret;
out_dput:
dput(dentry);
next prev parent reply other threads:[~2009-05-05 21:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 21:32 [patch 0/2] spufs: Minor cleanups jblunck
2009-05-05 21:32 ` jblunck [this message]
2009-05-12 14:03 ` [patch 1/2] spufs: make dentry reference count and locking symmetric Arnd Bergmann
2009-05-05 21:32 ` [patch 2/2] spufs: remove double check for non-negative dentry jblunck
2009-05-12 14:15 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090505214433.946117208@suse.de \
--to=jblunck@suse.de \
--cc=arndb@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox