[RFC PATCH v2 10/10] Change num_dumped value to global for debug messages.
Atsushi Kumagai
kumagai-atsushi at mxc.nes.nec.co.jp
Thu Jun 28 22:25:48 EDT 2012
num_dumped value is used to count the number of dumped pages.
The value is defined as local value and doesn't work correctly for cyclic
processing. (Because the value will be initialized by each cycle.)
This patch fix the above issue.
Signed-off-by: Atsushi Kumagai <kumagai-atsushi at mxc.nes.nec.co.jp>
---
makedumpfile.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/makedumpfile.c b/makedumpfile.c
index be0e15e..67e3727 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -44,6 +44,8 @@ unsigned long long pfn_cache_private;
unsigned long long pfn_user;
unsigned long long pfn_free;
+unsigned long long num_dumped;
+
int retcd = FAILED; /* return code */
#define INITIALIZE_LONG_TABLE(table, value) \
@@ -4627,7 +4629,7 @@ write_elf_pages(struct cache_data *cd_header, struct cache_data *cd_page)
int i, phnum;
long page_size = info->page_size;
unsigned long long pfn, pfn_start, pfn_end, paddr, num_excluded;
- unsigned long long num_dumpable, num_dumped = 0, per;
+ unsigned long long num_dumpable, per;
unsigned long long memsz, filesz;
unsigned long frac_head, frac_tail;
off_t off_seg_load, off_memory;
@@ -4972,7 +4974,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
long page_size = info->page_size;
unsigned char buf[info->page_size];
unsigned long long pfn, pfn_start, pfn_end, paddr, num_excluded;
- unsigned long long num_dumpable, per, num_dumped=0;
+ unsigned long long num_dumpable, per;
unsigned long long memsz, filesz;
unsigned long frac_head, frac_tail;
off_t off_seg_load, off_memory;
@@ -5189,7 +5191,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
int
write_kdump_pages(struct cache_data *cd_header, struct cache_data *cd_page)
{
- unsigned long long pfn, per, num_dumpable, num_dumped = 0;
+ unsigned long long pfn, per, num_dumpable;
unsigned long long start_pfn, end_pfn;
unsigned long size_out;
struct page_desc pd, pd_zero;
@@ -5383,7 +5385,6 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
struct page_desc pd;
unsigned char buf[info->page_size], *buf_out = NULL;
unsigned long len_buf_out;
- unsigned long long num_dumped=0;
struct timeval tv_start;
const off_t failed = (off_t)-1;
@@ -7279,7 +7280,7 @@ reassemble_kdump_pages(void)
off_t offset_first_ph, offset_ph_org, offset_eraseinfo;
off_t offset_data_new, offset_zero_page = 0;
unsigned long long pfn, start_pfn, end_pfn;
- unsigned long long num_dumpable, num_dumped;
+ unsigned long long num_dumpable;
unsigned long size_eraseinfo;
struct dump_bitmap bitmap2;
struct disk_dump_header dh;
--
1.7.9.2
More information about the kexec
mailing list