diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-26 13:58:53 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-22 16:01:29 -0400 |
commit | 765927b2d508712d320c8934db963bbe14c3fcec (patch) | |
tree | 97acdb14fae285764def396c4ed01d4d5c93e76a /arch/powerpc/platforms | |
parent | bf349a447059656ebe63fb4fd1ccb27ac1da22ad (diff) |
switch dentry_open() to struct path, make it grab references itself
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 1c9cac0cf895..d544d7816df3 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -317,7 +317,7 @@ out: | |||
317 | return ret; | 317 | return ret; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int spufs_context_open(struct dentry *dentry, struct vfsmount *mnt) | 320 | static int spufs_context_open(struct path *path) |
321 | { | 321 | { |
322 | int ret; | 322 | int ret; |
323 | struct file *filp; | 323 | struct file *filp; |
@@ -326,11 +326,7 @@ static int spufs_context_open(struct dentry *dentry, struct vfsmount *mnt) | |||
326 | if (ret < 0) | 326 | if (ret < 0) |
327 | return ret; | 327 | return ret; |
328 | 328 | ||
329 | /* | 329 | filp = dentry_open(path, O_RDONLY, current_cred()); |
330 | * get references for dget and mntget, will be released | ||
331 | * in error path of *_open(). | ||
332 | */ | ||
333 | filp = dentry_open(dget(dentry), mntget(mnt), O_RDONLY, current_cred()); | ||
334 | if (IS_ERR(filp)) { | 330 | if (IS_ERR(filp)) { |
335 | put_unused_fd(ret); | 331 | put_unused_fd(ret); |
336 | return PTR_ERR(filp); | 332 | return PTR_ERR(filp); |
@@ -452,6 +448,7 @@ spufs_create_context(struct inode *inode, struct dentry *dentry, | |||
452 | int affinity; | 448 | int affinity; |
453 | struct spu_gang *gang; | 449 | struct spu_gang *gang; |
454 | struct spu_context *neighbor; | 450 | struct spu_context *neighbor; |
451 | struct path path = {.mnt = mnt, .dentry = dentry}; | ||
455 | 452 | ||
456 | ret = -EPERM; | 453 | ret = -EPERM; |
457 | if ((flags & SPU_CREATE_NOSCHED) && | 454 | if ((flags & SPU_CREATE_NOSCHED) && |
@@ -494,7 +491,7 @@ spufs_create_context(struct inode *inode, struct dentry *dentry, | |||
494 | put_spu_context(neighbor); | 491 | put_spu_context(neighbor); |
495 | } | 492 | } |
496 | 493 | ||
497 | ret = spufs_context_open(dentry, mnt); | 494 | ret = spufs_context_open(&path); |
498 | if (ret < 0) { | 495 | if (ret < 0) { |
499 | WARN_ON(spufs_rmdir(inode, dentry)); | 496 | WARN_ON(spufs_rmdir(inode, dentry)); |
500 | if (affinity) | 497 | if (affinity) |
@@ -551,7 +548,7 @@ out: | |||
551 | return ret; | 548 | return ret; |
552 | } | 549 | } |
553 | 550 | ||
554 | static int spufs_gang_open(struct dentry *dentry, struct vfsmount *mnt) | 551 | static int spufs_gang_open(struct path *path) |
555 | { | 552 | { |
556 | int ret; | 553 | int ret; |
557 | struct file *filp; | 554 | struct file *filp; |
@@ -564,7 +561,7 @@ static int spufs_gang_open(struct dentry *dentry, struct vfsmount *mnt) | |||
564 | * get references for dget and mntget, will be released | 561 | * get references for dget and mntget, will be released |
565 | * in error path of *_open(). | 562 | * in error path of *_open(). |
566 | */ | 563 | */ |
567 | filp = dentry_open(dget(dentry), mntget(mnt), O_RDONLY, current_cred()); | 564 | filp = dentry_open(path, O_RDONLY, current_cred()); |
568 | if (IS_ERR(filp)) { | 565 | if (IS_ERR(filp)) { |
569 | put_unused_fd(ret); | 566 | put_unused_fd(ret); |
570 | return PTR_ERR(filp); | 567 | return PTR_ERR(filp); |
@@ -579,13 +576,14 @@ static int spufs_create_gang(struct inode *inode, | |||
579 | struct dentry *dentry, | 576 | struct dentry *dentry, |
580 | struct vfsmount *mnt, umode_t mode) | 577 | struct vfsmount *mnt, umode_t mode) |
581 | { | 578 | { |
579 | struct path path = {.mnt = mnt, .dentry = dentry}; | ||
582 | int ret; | 580 | int ret; |
583 | 581 | ||
584 | ret = spufs_mkgang(inode, dentry, mode & S_IRWXUGO); | 582 | ret = spufs_mkgang(inode, dentry, mode & S_IRWXUGO); |
585 | if (ret) | 583 | if (ret) |
586 | goto out; | 584 | goto out; |
587 | 585 | ||
588 | ret = spufs_gang_open(dentry, mnt); | 586 | ret = spufs_gang_open(&path); |
589 | if (ret < 0) { | 587 | if (ret < 0) { |
590 | int err = simple_rmdir(inode, dentry); | 588 | int err = simple_rmdir(inode, dentry); |
591 | WARN_ON(err); | 589 | WARN_ON(err); |