diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/inode.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 427d00a4f6a0..787ae71a6859 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -258,7 +258,12 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, | |||
258 | 258 | ||
259 | inode->i_op = &spufs_dir_inode_operations; | 259 | inode->i_op = &spufs_dir_inode_operations; |
260 | inode->i_fop = &simple_dir_operations; | 260 | inode->i_fop = &simple_dir_operations; |
261 | ret = spufs_fill_dir(dentry, spufs_dir_contents, mode, ctx); | 261 | if (flags & SPU_CREATE_NOSCHED) |
262 | ret = spufs_fill_dir(dentry, spufs_dir_nosched_contents, | ||
263 | mode, ctx); | ||
264 | else | ||
265 | ret = spufs_fill_dir(dentry, spufs_dir_contents, mode, ctx); | ||
266 | |||
262 | if (ret) | 267 | if (ret) |
263 | goto out_free_ctx; | 268 | goto out_free_ctx; |
264 | 269 | ||
@@ -307,6 +312,16 @@ static int spufs_create_context(struct inode *inode, | |||
307 | { | 312 | { |
308 | int ret; | 313 | int ret; |
309 | 314 | ||
315 | ret = -EPERM; | ||
316 | if ((flags & SPU_CREATE_NOSCHED) && | ||
317 | !capable(CAP_SYS_NICE)) | ||
318 | goto out_unlock; | ||
319 | |||
320 | ret = -EINVAL; | ||
321 | if ((flags & (SPU_CREATE_NOSCHED | SPU_CREATE_ISOLATE)) | ||
322 | == SPU_CREATE_ISOLATE) | ||
323 | goto out_unlock; | ||
324 | |||
310 | ret = spufs_mkdir(inode, dentry, flags, mode & S_IRWXUGO); | 325 | ret = spufs_mkdir(inode, dentry, flags, mode & S_IRWXUGO); |
311 | if (ret) | 326 | if (ret) |
312 | goto out_unlock; | 327 | goto out_unlock; |