platform.c (98e44fda2ea19c0e8b0a2e0e4dcd3461251f09ea) | platform.c (235f6d157d43a761052e643b8799f86fdc87b47f) |
---|---|
1/* 2 * Persistent Storage - platform driver interface parts. 3 * 4 * Copyright (C) 2007-2008 Google, Inc. 5 * Copyright (C) 2010 Intel Corporation <tony.luck@intel.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 292 unchanged lines hidden (view full) --- 301 } 302 oopscount++; 303 while (total < kmsg_bytes) { 304 char *dst; 305 unsigned long size; 306 int hsize; 307 int zipped_len = -1; 308 size_t len; | 1/* 2 * Persistent Storage - platform driver interface parts. 3 * 4 * Copyright (C) 2007-2008 Google, Inc. 5 * Copyright (C) 2010 Intel Corporation <tony.luck@intel.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 292 unchanged lines hidden (view full) --- 301 } 302 oopscount++; 303 while (total < kmsg_bytes) { 304 char *dst; 305 unsigned long size; 306 int hsize; 307 int zipped_len = -1; 308 size_t len; |
309 bool compressed; | 309 bool compressed = false; |
310 size_t total_len; 311 312 if (big_oops_buf && is_locked) { 313 dst = big_oops_buf; | 310 size_t total_len; 311 312 if (big_oops_buf && is_locked) { 313 dst = big_oops_buf; |
314 hsize = sprintf(dst, "%s#%d Part%u\n", why, 315 oopscount, part); 316 size = big_oops_buf_sz - hsize; | 314 size = big_oops_buf_sz; 315 } else { 316 dst = psinfo->buf; 317 size = psinfo->bufsize; 318 } |
317 | 319 |
318 if (!kmsg_dump_get_buffer(dumper, true, dst + hsize, 319 size, &len)) 320 break; | 320 hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount, part); 321 size -= hsize; |
321 | 322 |
323 if (!kmsg_dump_get_buffer(dumper, true, dst + hsize, 324 size, &len)) 325 break; 326 327 if (big_oops_buf && is_locked) { |
|
322 zipped_len = pstore_compress(dst, psinfo->buf, 323 hsize + len, psinfo->bufsize); 324 325 if (zipped_len > 0) { 326 compressed = true; 327 total_len = zipped_len; 328 } else { | 328 zipped_len = pstore_compress(dst, psinfo->buf, 329 hsize + len, psinfo->bufsize); 330 331 if (zipped_len > 0) { 332 compressed = true; 333 total_len = zipped_len; 334 } else { |
329 compressed = false; | |
330 total_len = copy_kmsg_to_buffer(hsize, len); 331 } 332 } else { | 335 total_len = copy_kmsg_to_buffer(hsize, len); 336 } 337 } else { |
333 dst = psinfo->buf; 334 hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount, 335 part); 336 size = psinfo->bufsize - hsize; 337 dst += hsize; 338 339 if (!kmsg_dump_get_buffer(dumper, true, dst, 340 size, &len)) 341 break; 342 343 compressed = false; | |
344 total_len = hsize + len; 345 } 346 347 ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, 348 oopscount, compressed, total_len, psinfo); 349 if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) 350 pstore_new_entry = 1; 351 --- 244 unchanged lines hidden --- | 338 total_len = hsize + len; 339 } 340 341 ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, 342 oopscount, compressed, total_len, psinfo); 343 if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) 344 pstore_new_entry = 1; 345 --- 244 unchanged lines hidden --- |