/* These are the only things you should do on a core-file: use only these functions to write out all the necessary info.  */
static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
/* These are the only things you should do on a core-file: use only these functions to write out all the necessary info.  */
static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
{
	unsigned long limit = rlimit(RLIMIT_CORE);
	ssize_t written;
	if (*foffset + nr > limit)
		return -EIO;
	written = file->f_op->write(file, addr, nr, &file->f_pos);
	*foffset += written;
	if (written != nr)
		return -EIO;
	return 0;
}