-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 186314 b: refs/heads/master c: 088e7af h: refs/heads/master v: v3
- Loading branch information
Daisuke HATAYAMA
authored and
Linus Torvalds
committed
Mar 6, 2010
1 parent
51d42ea
commit 3332ff5
Showing
5 changed files
with
80 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 05f47fda9fc5b17bfab189e9d54228025befc996 | ||
refs/heads/master: 088e7af73a962fcc8883b7a6392544d8342553d6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _LINUX_COREDUMP_H | ||
#define _LINUX_COREDUMP_H | ||
|
||
#include <linux/types.h> | ||
#include <linux/mm.h> | ||
#include <linux/fs.h> | ||
|
||
/* | ||
* These are the only things you should do on a core-file: use only these | ||
* functions to write out all the necessary info. | ||
*/ | ||
static inline int dump_write(struct file *file, const void *addr, int nr) | ||
{ | ||
return file->f_op->write(file, addr, nr, &file->f_pos) == nr; | ||
} | ||
|
||
static inline int dump_seek(struct file *file, loff_t off) | ||
{ | ||
if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | ||
if (file->f_op->llseek(file, off, SEEK_CUR) < 0) | ||
return 0; | ||
} else { | ||
char *buf = (char *)get_zeroed_page(GFP_KERNEL); | ||
|
||
if (!buf) | ||
return 0; | ||
while (off > 0) { | ||
unsigned long n = off; | ||
|
||
if (n > PAGE_SIZE) | ||
n = PAGE_SIZE; | ||
if (!dump_write(file, buf, n)) | ||
return 0; | ||
off -= n; | ||
} | ||
free_page((unsigned long)buf); | ||
} | ||
return 1; | ||
} | ||
|
||
#endif /* _LINUX_COREDUMP_H */ |