[Cbe-oss-dev] [PATCH 4/9] Move the NOSCHED test into spufs_arch_notes_size()

Michael Ellerman michael at ellerman.id.au
Fri Aug 17 17:19:11 EST 2007


Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
 arch/powerpc/platforms/cell/spufs/coredump.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 741d05f..d1d9148 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -100,16 +100,11 @@ static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info, int dfd)
 	return total;
 }
 
-static int spufs_add_one_context(struct file *file, int dfd)
+static int spufs_add_one_context(struct spu_context *ctx, int dfd)
 {
-	struct spu_context *ctx;
 	struct spufs_ctx_info *ctx_info;
 	int size;
 
-	ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
-	if (ctx->flags & SPU_CREATE_NOSCHED)
-		return 0;
-
 	ctx_info = kzalloc(sizeof(*ctx_info), GFP_KERNEL);
 	if (unlikely(!ctx_info))
 		return -ENOMEM;
@@ -135,6 +130,7 @@ static int spufs_arch_notes_size(void)
 {
 	struct fdtable *fdt = files_fdtable(current->files);
 	struct file *file;
+	struct spu_context *ctx;
 	int size = 0, rc, fd;
 
 	for (fd = 0; fd < fdt->max_fds; fd++) {
@@ -146,7 +142,11 @@ static int spufs_arch_notes_size(void)
 		if (!file || file->f_op != &spufs_context_fops)
 			continue;
 
-		rc = spufs_add_one_context(file, fd);
+		ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
+		if (ctx->flags & SPU_CREATE_NOSCHED)
+			continue;
+
+		rc = spufs_add_one_context(ctx, fd);
 		if (rc < 0)
 			break;
 
-- 
1.5.1.3.g7a33b




More information about the cbe-oss-dev mailing list