Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328982
b: refs/heads/master
c: 2be7fd5
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 70983a5 commit 3e7d615
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 179e037fc1370288188cb1f90b81156d75a3cb2d
refs/heads/master: 2be7fd55d44882c9818ed2d1dabc0f0abab5eeed
40 changes: 20 additions & 20 deletions trunk/arch/powerpc/platforms/cell/spufs/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
return total;
}

static int match_context(const void *v, struct file *file, unsigned fd)
{
struct spu_context *ctx;
if (file->f_op != &spufs_context_fops)
return 0;
ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
if (ctx->flags & SPU_CREATE_NOSCHED)
return 0;
return fd + 1;
}

/*
* The additional architecture-specific notes for Cell are various
* context files in the spu context.
Expand All @@ -115,29 +126,18 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
* internal functionality to dump them without needing to actually
* open the files.
*/
/*
* descriptor table is not shared, so files can't change or go away.
*/
static struct spu_context *coredump_next_context(int *fd)
{
struct fdtable *fdt = files_fdtable(current->files);
struct file *file;
struct spu_context *ctx = NULL;

for (; *fd < fdt->max_fds; (*fd)++) {
if (!fd_is_open(*fd, fdt))
continue;

file = fcheck(*fd);

if (!file || file->f_op != &spufs_context_fops)
continue;

ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
if (ctx->flags & SPU_CREATE_NOSCHED)
continue;

break;
}

return ctx;
int n = iterate_fd(current->files, *fd, match_context, NULL);
if (!n)
return NULL;
*fd = n - 1;
file = fcheck(*fd);
return SPUFS_I(file->f_dentry->d_inode)->i_ctx;
}

int spufs_coredump_extra_notes_size(void)
Expand Down

0 comments on commit 3e7d615

Please sign in to comment.