[Cbe-oss-dev] [PATCH 2/9] Pass the dfd explicitly rather than via the ctx_info struct

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


Another step on the way to getting rid of the ctx_info struct.

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

diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 1136c77..520aa24 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -77,14 +77,12 @@ static u64 ctx_ls_size(struct spu_context *ctx)
 	return ctx->csa.priv2.spu_lslr_RW + 1;
 }
 
-static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info)
+static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info, int dfd)
 {
-	int dfd, i, sz, total = 0;
+	int i, sz, total = 0;
 	char *name;
 	char fullname[80];
 
-	dfd = ctx_info->dfd;
-
 	for (i = 0; spufs_coredump_read[i].name; i++) {
 		name = spufs_coredump_read[i].name;
 		sz = spufs_coredump_read[i].size;
@@ -119,7 +117,7 @@ static int spufs_add_one_context(struct file *file, int dfd)
 	ctx_info->dfd = dfd;
 	ctx_info->ctx = ctx;
 
-	size = spufs_ctx_note_size(ctx_info);
+	size = spufs_ctx_note_size(ctx_info, dfd);
 	list_add(&ctx_info->list, &ctx_info_list);
 	return size;
 }
@@ -155,11 +153,11 @@ static int spufs_arch_notes_size(void)
 }
 
 static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
-				struct file *file)
+				struct file *file, int dfd)
 {
 	struct spu_context *ctx;
 	loff_t pos = 0;
-	int sz, dfd, rc, total = 0;
+	int sz, rc, total = 0;
 	const int bufsz = PAGE_SIZE;
 	char *name;
 	char fullname[80], *buf;
@@ -169,7 +167,6 @@ static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
 	if (!buf)
 		return;
 
-	dfd = ctx_info->dfd;
 	name = spufs_coredump_read[i].name;
 
 	if (!strcmp(name, "mem"))
@@ -216,7 +213,7 @@ static void spufs_arch_write_notes(struct file *file)
 	list_for_each_entry_safe(ctx_info, next, &ctx_info_list, list) {
 		spu_acquire_saved(ctx_info->ctx);
 		for (j = 0; j < spufs_coredump_num_notes; j++)
-			spufs_arch_write_note(ctx_info, j, file);
+			spufs_arch_write_note(ctx_info, j, file, ctx_info->dfd);
 		spu_release_saved(ctx_info->ctx);
 		list_del(&ctx_info->list);
 		kfree(ctx_info);
-- 
1.5.1.3.g7a33b




More information about the cbe-oss-dev mailing list