Lines Matching refs:record
371 void pstore_record_init(struct pstore_record *record, in pstore_record_init() argument
374 memset(record, 0, sizeof(*record)); in pstore_record_init()
376 record->psi = psinfo; in pstore_record_init()
379 record->time = ns_to_timespec64(ktime_get_real_fast_ns()); in pstore_record_init()
417 struct pstore_record record; in pstore_dump() local
419 pstore_record_init(&record, psinfo); in pstore_dump()
420 record.type = PSTORE_TYPE_DMESG; in pstore_dump()
421 record.count = oopscount; in pstore_dump()
422 record.reason = reason; in pstore_dump()
423 record.part = part; in pstore_dump()
424 record.buf = psinfo->buf; in pstore_dump()
450 record.compressed = true; in pstore_dump()
451 record.size = zipped_len; in pstore_dump()
453 record.size = copy_kmsg_to_buffer(header_size, in pstore_dump()
457 record.size = header_size + dump_size; in pstore_dump()
460 ret = psinfo->write(&record); in pstore_dump()
466 total += record.size; in pstore_dump()
492 struct pstore_record record; in pstore_console_write() local
497 pstore_record_init(&record, psinfo); in pstore_console_write()
498 record.type = PSTORE_TYPE_CONSOLE; in pstore_console_write()
500 record.buf = (char *)s; in pstore_console_write()
501 record.size = c; in pstore_console_write()
502 psinfo->write(&record); in pstore_console_write()
532 static int pstore_write_user_compat(struct pstore_record *record, in pstore_write_user_compat() argument
537 if (record->buf) in pstore_write_user_compat()
540 record->buf = memdup_user(buf, record->size); in pstore_write_user_compat()
541 if (IS_ERR(record->buf)) { in pstore_write_user_compat()
542 ret = PTR_ERR(record->buf); in pstore_write_user_compat()
546 ret = record->psi->write(record); in pstore_write_user_compat()
548 kfree(record->buf); in pstore_write_user_compat()
550 record->buf = NULL; in pstore_write_user_compat()
552 return unlikely(ret < 0) ? ret : record->size; in pstore_write_user_compat()
669 static void decompress_record(struct pstore_record *record) in decompress_record() argument
675 if (!IS_ENABLED(CONFIG_PSTORE_COMPRESS) || !record->compressed) in decompress_record()
679 if (record->type != PSTORE_TYPE_DMESG) { in decompress_record()
680 pr_warn("ignored compressed record type %d\n", record->type); in decompress_record()
692 workspace = kmalloc(unzipped_len + record->ecc_notice_size, in decompress_record()
698 ret = crypto_comp_decompress(tfm, record->buf, record->size, in decompress_record()
707 memcpy(workspace + unzipped_len, record->buf + record->size, in decompress_record()
708 record->ecc_notice_size); in decompress_record()
711 unzipped = kmemdup(workspace, unzipped_len + record->ecc_notice_size, in decompress_record()
718 kfree(record->buf); in decompress_record()
719 record->buf = unzipped; in decompress_record()
720 record->size = unzipped_len; in decompress_record()
721 record->compressed = false; in decompress_record()
749 struct pstore_record *record; in pstore_get_backend_records() local
752 record = kzalloc(sizeof(*record), GFP_KERNEL); in pstore_get_backend_records()
753 if (!record) { in pstore_get_backend_records()
757 pstore_record_init(record, psi); in pstore_get_backend_records()
759 record->size = psi->read(record); in pstore_get_backend_records()
762 if (record->size <= 0) { in pstore_get_backend_records()
763 kfree(record); in pstore_get_backend_records()
767 decompress_record(record); in pstore_get_backend_records()
768 rc = pstore_mkfile(root, record); in pstore_get_backend_records()
771 kfree(record->buf); in pstore_get_backend_records()
772 kfree(record->priv); in pstore_get_backend_records()
773 kfree(record); in pstore_get_backend_records()