[PATCH v1 1/4] Add write_cd_buf
Zhou Wenjian
zhouwj-fnst at cn.fujitsu.com
Thu Jul 9 19:28:50 PDT 2015
write_cd_buf is used to write the data of cache_data into file.
Signed-off-by: Zhou Wenjian <zhouwj-fnst at cn.fujitsu.com>
---
makedumpfile.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/makedumpfile.c b/makedumpfile.c
index cc71f20..5a53246 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -6286,6 +6286,20 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
}
int
+write_cd_buf(struct cache_data *cd)
+{
+ if (cd->buf_size == 0)
+ return TRUE;
+
+ if (!write_buffer(cd->fd, cd->offset, cd->buf,
+ cd->buf_size, cd->file_name)) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+int
write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page,
struct page_desc *pd_zero, off_t *offset_data, struct cycle *cycle)
{
--
1.8.3.1
More information about the kexec
mailing list