Lines Matching full:record

224 	 * uncompressed record size, since any record that would be expanded by  in allocate_buf_for_compression()
262 void pstore_record_init(struct pstore_record *record, in pstore_record_init() argument
265 memset(record, 0, sizeof(*record)); in pstore_record_init()
267 record->psi = psinfo; in pstore_record_init()
270 record->time = ns_to_timespec64(ktime_get_real_fast_ns()); in pstore_record_init()
309 struct pstore_record record; in pstore_dump() local
311 pstore_record_init(&record, psinfo); in pstore_dump()
312 record.type = PSTORE_TYPE_DMESG; in pstore_dump()
313 record.count = oopscount; in pstore_dump()
314 record.reason = detail->reason; in pstore_dump()
315 record.part = part; in pstore_dump()
316 record.buf = psinfo->buf; in pstore_dump()
337 record.compressed = true; in pstore_dump()
338 record.size = zipped_len; in pstore_dump()
345 * the pstore record, and discard the rest. in pstore_dump()
347 record.size = psinfo->bufsize; in pstore_dump()
351 record.size = header_size + dump_size; in pstore_dump()
354 ret = psinfo->write(&record); in pstore_dump()
364 total += record.size; in pstore_dump()
395 struct pstore_record record; in pstore_console_write() local
400 pstore_record_init(&record, psinfo); in pstore_console_write()
401 record.type = PSTORE_TYPE_CONSOLE; in pstore_console_write()
403 record.buf = (char *)s; in pstore_console_write()
404 record.size = c; in pstore_console_write()
405 psinfo->write(&record); in pstore_console_write()
435 static int pstore_write_user_compat(struct pstore_record *record, in pstore_write_user_compat() argument
440 if (record->buf) in pstore_write_user_compat()
443 record->buf = vmemdup_user(buf, record->size); in pstore_write_user_compat()
444 if (IS_ERR(record->buf)) { in pstore_write_user_compat()
445 ret = PTR_ERR(record->buf); in pstore_write_user_compat()
449 ret = record->psi->write(record); in pstore_write_user_compat()
451 kvfree(record->buf); in pstore_write_user_compat()
453 record->buf = NULL; in pstore_write_user_compat()
455 return unlikely(ret < 0) ? ret : record->size; in pstore_write_user_compat()
582 static void decompress_record(struct pstore_record *record, in decompress_record() argument
590 if (!IS_ENABLED(CONFIG_PSTORE_COMPRESS) || !record->compressed) in decompress_record()
594 if (record->type != PSTORE_TYPE_DMESG) { in decompress_record()
595 pr_warn("ignored compressed record type %d\n", record->type); in decompress_record()
613 workspace = kvzalloc(max_uncompressed_size + record->ecc_notice_size, in decompress_record()
618 zstream->next_in = record->buf; in decompress_record()
619 zstream->avail_in = record->size; in decompress_record()
633 memcpy(workspace + unzipped_len, record->buf + record->size, in decompress_record()
634 record->ecc_notice_size); in decompress_record()
637 unzipped = kvmemdup(workspace, unzipped_len + record->ecc_notice_size, in decompress_record()
644 kvfree(record->buf); in decompress_record()
645 record->buf = unzipped; in decompress_record()
646 record->size = unzipped_len; in decompress_record()
647 record->compressed = false; in decompress_record()
677 * Backend callback read() allocates record.buf. decompress_record() in pstore_get_backend_records()
678 * may reallocate record.buf. On success, pstore_mkfile() will keep in pstore_get_backend_records()
679 * the record.buf, so free it only on failure. in pstore_get_backend_records()
682 struct pstore_record *record; in pstore_get_backend_records() local
685 record = kzalloc(sizeof(*record), GFP_KERNEL); in pstore_get_backend_records()
686 if (!record) { in pstore_get_backend_records()
687 pr_err("out of memory creating record\n"); in pstore_get_backend_records()
690 pstore_record_init(record, psi); in pstore_get_backend_records()
692 record->size = psi->read(record); in pstore_get_backend_records()
695 if (record->size <= 0) { in pstore_get_backend_records()
696 kfree(record); in pstore_get_backend_records()
700 decompress_record(record, &zstream); in pstore_get_backend_records()
701 rc = pstore_mkfile(root, record); in pstore_get_backend_records()
703 /* pstore_mkfile() did not take record, so free it. */ in pstore_get_backend_records()
704 kvfree(record->buf); in pstore_get_backend_records()
705 kfree(record->priv); in pstore_get_backend_records()
706 kfree(record); in pstore_get_backend_records()
723 pr_warn("failed to create %d record(s) from '%s'\n", in pstore_get_backend_records()