Lines Matching refs:record

370 void pstore_record_init(struct pstore_record *record,  in pstore_record_init()  argument
373 memset(record, 0, sizeof(*record)); in pstore_record_init()
375 record->psi = psinfo; in pstore_record_init()
378 record->time = ns_to_timespec64(ktime_get_real_fast_ns()); in pstore_record_init()
418 struct pstore_record record; in pstore_dump() local
420 pstore_record_init(&record, psinfo); in pstore_dump()
421 record.type = PSTORE_TYPE_DMESG; in pstore_dump()
422 record.count = oopscount; in pstore_dump()
423 record.reason = reason; in pstore_dump()
424 record.part = part; in pstore_dump()
425 record.buf = psinfo->buf; in pstore_dump()
451 record.compressed = true; in pstore_dump()
452 record.size = zipped_len; in pstore_dump()
454 record.size = copy_kmsg_to_buffer(header_size, in pstore_dump()
458 record.size = header_size + dump_size; in pstore_dump()
461 ret = psinfo->write(&record); in pstore_dump()
467 total += record.size; in pstore_dump()
494 struct pstore_record record; in pstore_console_write() local
499 pstore_record_init(&record, psinfo); in pstore_console_write()
500 record.type = PSTORE_TYPE_CONSOLE; in pstore_console_write()
502 record.buf = (char *)s; in pstore_console_write()
503 record.size = c; in pstore_console_write()
504 psinfo->write(&record); in pstore_console_write()
534 static int pstore_write_user_compat(struct pstore_record *record, in pstore_write_user_compat() argument
539 if (record->buf) in pstore_write_user_compat()
542 record->buf = memdup_user(buf, record->size); in pstore_write_user_compat()
543 if (IS_ERR(record->buf)) { in pstore_write_user_compat()
544 ret = PTR_ERR(record->buf); in pstore_write_user_compat()
548 ret = record->psi->write(record); in pstore_write_user_compat()
550 kfree(record->buf); in pstore_write_user_compat()
552 record->buf = NULL; in pstore_write_user_compat()
554 return unlikely(ret < 0) ? ret : record->size; in pstore_write_user_compat()
671 static void decompress_record(struct pstore_record *record) in decompress_record() argument
677 if (!IS_ENABLED(CONFIG_PSTORE_COMPRESS) || !record->compressed) in decompress_record()
681 if (record->type != PSTORE_TYPE_DMESG) { in decompress_record()
682 pr_warn("ignored compressed record type %d\n", record->type); in decompress_record()
694 workspace = kmalloc(unzipped_len + record->ecc_notice_size, in decompress_record()
700 ret = crypto_comp_decompress(tfm, record->buf, record->size, in decompress_record()
709 memcpy(workspace + unzipped_len, record->buf + record->size, in decompress_record()
710 record->ecc_notice_size); in decompress_record()
713 unzipped = kmemdup(workspace, unzipped_len + record->ecc_notice_size, in decompress_record()
720 kfree(record->buf); in decompress_record()
721 record->buf = unzipped; in decompress_record()
722 record->size = unzipped_len; in decompress_record()
723 record->compressed = false; in decompress_record()
751 struct pstore_record *record; in pstore_get_backend_records() local
754 record = kzalloc(sizeof(*record), GFP_KERNEL); in pstore_get_backend_records()
755 if (!record) { in pstore_get_backend_records()
759 pstore_record_init(record, psi); in pstore_get_backend_records()
761 record->size = psi->read(record); in pstore_get_backend_records()
764 if (record->size <= 0) { in pstore_get_backend_records()
765 kfree(record); in pstore_get_backend_records()
769 decompress_record(record); in pstore_get_backend_records()
770 rc = pstore_mkfile(root, record); in pstore_get_backend_records()
773 kfree(record->buf); in pstore_get_backend_records()
774 kfree(record); in pstore_get_backend_records()