[POWERPC] spufs: Handle errors in SPU coredump code, and support coredump to a pipe

Rework spufs_coredump_extra_notes_write() to check for and return errors.

If we're coredumping to a pipe we can't trust file->f_pos, we need to
maintain the foffset value passed to us. The cleanest way to do this is
to have the low level write routine increment foffset when we've
successfully written.

Signed-off-by: Michael Ellerman <[email protected]>
Signed-off-by: Jeremy Kerr <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
Michael Ellerman 2007-09-19 14:38:12 +10:00 • committed by Paul Mackerras
commit 7af1443a9d
4 changed files with 67 additions and 34 deletions

View file

@ -245,7 +245,7 @@ struct spufs_calls {
long (*spu_run)(struct file *filp, __u32 __user *unpc,
__u32 __user *ustatus);
int (*coredump_extra_notes_size)(void);
void (*coredump_extra_notes_write)(struct file *file);
int (*coredump_extra_notes_write)(struct file *file, loff_t *foffset);
struct module *owner;
};