Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312985
b: refs/heads/master
c: bf349a4
h: refs/heads/master
i:
  312983: 5406675
v: v3
  • Loading branch information
Al Viro committed Jul 22, 2012
1 parent 072c9da commit af3c429
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b6456d2c3fc9d0c4ec1db5d6594f40098ff0a6f
refs/heads/master: bf349a447059656ebe63fb4fd1ccb27ac1da22ad
46 changes: 18 additions & 28 deletions trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,22 +323,21 @@ static int spufs_context_open(struct dentry *dentry, struct vfsmount *mnt)
struct file *filp;

ret = get_unused_fd();
if (ret < 0) {
dput(dentry);
mntput(mnt);
goto out;
}
if (ret < 0)
return ret;

filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
/*
* get references for dget and mntget, will be released
* in error path of *_open().
*/
filp = dentry_open(dget(dentry), mntget(mnt), O_RDONLY, current_cred());
if (IS_ERR(filp)) {
put_unused_fd(ret);
ret = PTR_ERR(filp);
goto out;
return PTR_ERR(filp);
}

filp->f_op = &spufs_context_fops;
fd_install(ret, filp);
out:
return ret;
}

Expand Down Expand Up @@ -495,11 +494,7 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
put_spu_context(neighbor);
}

/*
* get references for dget and mntget, will be released
* in error path of *_open().
*/
ret = spufs_context_open(dget(dentry), mntget(mnt));
ret = spufs_context_open(dentry, mnt);
if (ret < 0) {
WARN_ON(spufs_rmdir(inode, dentry));
if (affinity)
Expand Down Expand Up @@ -562,22 +557,21 @@ static int spufs_gang_open(struct dentry *dentry, struct vfsmount *mnt)
struct file *filp;

ret = get_unused_fd();
if (ret < 0) {
dput(dentry);
mntput(mnt);
goto out;
}
if (ret < 0)
return ret;

filp = dentry_open(dentry, mnt, O_RDONLY, current_cred());
/*
* get references for dget and mntget, will be released
* in error path of *_open().
*/
filp = dentry_open(dget(dentry), mntget(mnt), O_RDONLY, current_cred());
if (IS_ERR(filp)) {
put_unused_fd(ret);
ret = PTR_ERR(filp);
goto out;
return PTR_ERR(filp);
}

filp->f_op = &simple_dir_operations;
fd_install(ret, filp);
out:
return ret;
}

Expand All @@ -591,11 +585,7 @@ static int spufs_create_gang(struct inode *inode,
if (ret)
goto out;

/*
* get references for dget and mntget, will be released
* in error path of *_open().
*/
ret = spufs_gang_open(dget(dentry), mntget(mnt));
ret = spufs_gang_open(dentry, mnt);
if (ret < 0) {
int err = simple_rmdir(inode, dentry);
WARN_ON(err);
Expand Down

0 comments on commit af3c429

Please sign in to comment.