diff options
author | Mark Nutter <mnutter@us.ibm.com> | 2006-10-24 12:31:16 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-25 00:20:21 -0400 |
commit | 5737edd1ddbde5ab7f63bb3cb36015edbdb7c295 (patch) | |
tree | 10162eb7c27fa0a3d1614c2d46fdcf2c87410d3a /arch/powerpc/platforms/cell/spufs/inode.c | |
parent | cc21a66d7f727ab97b27af9cf763bc0b51510ffa (diff) |
[POWERPC] spufs: add support for nonschedulable contexts
This adds two new flags to spu_create:
SPU_CREATE_NONSCHED: create a context that is never moved
away from an SPE once it has started running. This flag
can only be used by tasks with the CAP_SYS_NICE capability.
SPU_CREATE_ISOLATED: create a nonschedulable context that
enters isolation mode upon first run. This requires the
SPU_CREATE_NONSCHED flag.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
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; |