Lines Matching refs:rcd
977 struct cper_pstore_record *rcd; in erst_reader() local
978 size_t rcd_len = sizeof(*rcd) + erst_info.bufsize; in erst_reader()
983 rcd = kmalloc(rcd_len, GFP_KERNEL); in erst_reader()
984 if (!rcd) { in erst_reader()
999 len = erst_read(record_id, &rcd->hdr, rcd_len); in erst_reader()
1003 else if (len < 0 || len < sizeof(*rcd)) { in erst_reader()
1007 if (!guid_equal(&rcd->hdr.creator_id, &CPER_CREATOR_PSTORE)) in erst_reader()
1015 memcpy(record->buf, rcd->data, len - sizeof(*rcd)); in erst_reader()
1019 if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG_Z)) { in erst_reader()
1022 } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG)) in erst_reader()
1024 else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) in erst_reader()
1029 if (rcd->hdr.validation_bits & CPER_VALID_TIMESTAMP) in erst_reader()
1030 record->time.tv_sec = rcd->hdr.timestamp; in erst_reader()
1036 kfree(rcd); in erst_reader()
1037 return (rc < 0) ? rc : (len - sizeof(*rcd)); in erst_reader()
1042 struct cper_pstore_record *rcd = (struct cper_pstore_record *) in erst_writer() local
1043 (erst_info.buf - sizeof(*rcd)); in erst_writer()
1046 memset(rcd, 0, sizeof(*rcd)); in erst_writer()
1047 memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); in erst_writer()
1048 rcd->hdr.revision = CPER_RECORD_REV; in erst_writer()
1049 rcd->hdr.signature_end = CPER_SIG_END; in erst_writer()
1050 rcd->hdr.section_count = 1; in erst_writer()
1051 rcd->hdr.error_severity = CPER_SEV_FATAL; in erst_writer()
1053 rcd->hdr.validation_bits = CPER_VALID_TIMESTAMP; in erst_writer()
1054 rcd->hdr.timestamp = ktime_get_real_seconds(); in erst_writer()
1055 rcd->hdr.record_length = sizeof(*rcd) + record->size; in erst_writer()
1056 rcd->hdr.creator_id = CPER_CREATOR_PSTORE; in erst_writer()
1057 rcd->hdr.notification_type = CPER_NOTIFY_MCE; in erst_writer()
1058 rcd->hdr.record_id = cper_next_record_id(); in erst_writer()
1059 rcd->hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; in erst_writer()
1061 rcd->sec_hdr.section_offset = sizeof(*rcd); in erst_writer()
1062 rcd->sec_hdr.section_length = record->size; in erst_writer()
1063 rcd->sec_hdr.revision = CPER_SEC_REV; in erst_writer()
1065 rcd->sec_hdr.validation_bits = 0; in erst_writer()
1066 rcd->sec_hdr.flags = CPER_SEC_PRIMARY; in erst_writer()
1070 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG_Z; in erst_writer()
1072 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG; in erst_writer()
1075 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE; in erst_writer()
1080 rcd->sec_hdr.section_severity = CPER_SEV_FATAL; in erst_writer()
1082 ret = erst_write(&rcd->hdr); in erst_writer()
1083 record->id = rcd->hdr.record_id; in erst_writer()