Skip to content

Commit 67cba9f

Browse files
author
Al Viro
committed
move spu_forget() into spufs_rmdir()
now that __fput() is *not* done in any callchain containing mmput(), we can do that... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 8cae6f7 commit 67cba9f

File tree

1 file changed

+5
-6
lines changed
  • arch/powerpc/platforms/cell/spufs

1 file changed

+5
-6
lines changed

arch/powerpc/platforms/cell/spufs/inode.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,13 @@ static void spufs_prune_dir(struct dentry *dir)
186186
static int spufs_rmdir(struct inode *parent, struct dentry *dir)
187187
{
188188
/* remove all entries */
189+
int res;
189190
spufs_prune_dir(dir);
190191
d_drop(dir);
191-
192-
return simple_rmdir(parent, dir);
192+
res = simple_rmdir(parent, dir);
193+
/* We have to give up the mm_struct */
194+
spu_forget(SPUFS_I(dir->d_inode)->i_ctx);
195+
return res;
193196
}
194197

195198
static int spufs_fill_dir(struct dentry *dir,
@@ -245,9 +248,6 @@ static int spufs_dir_close(struct inode *inode, struct file *file)
245248
mutex_unlock(&parent->i_mutex);
246249
WARN_ON(ret);
247250

248-
/* We have to give up the mm_struct */
249-
spu_forget(ctx);
250-
251251
return dcache_dir_close(inode, file);
252252
}
253253

@@ -497,7 +497,6 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
497497
if (affinity)
498498
mutex_unlock(&gang->aff_mutex);
499499
mutex_unlock(&inode->i_mutex);
500-
spu_forget(SPUFS_I(dentry->d_inode)->i_ctx);
501500
goto out;
502501
}
503502

0 commit comments

Comments
 (0)