Lines Matching refs:rcd
1074 struct cper_pstore_record *rcd; in erst_reader() local
1075 size_t rcd_len = sizeof(*rcd) + erst_info.bufsize; in erst_reader()
1080 rcd = kmalloc(rcd_len, GFP_KERNEL); in erst_reader()
1081 if (!rcd) { in erst_reader()
1096 len = erst_read_record(record_id, &rcd->hdr, rcd_len, sizeof(*rcd), in erst_reader()
1109 memcpy(record->buf, rcd->data, len - sizeof(*rcd)); in erst_reader()
1113 if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG_Z)) { in erst_reader()
1116 } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG)) in erst_reader()
1118 else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) in erst_reader()
1123 if (rcd->hdr.validation_bits & CPER_VALID_TIMESTAMP) in erst_reader()
1124 record->time.tv_sec = rcd->hdr.timestamp; in erst_reader()
1130 kfree(rcd); in erst_reader()
1131 return (rc < 0) ? rc : (len - sizeof(*rcd)); in erst_reader()
1136 struct cper_pstore_record *rcd = (struct cper_pstore_record *) in erst_writer() local
1137 (erst_info.buf - sizeof(*rcd)); in erst_writer()
1140 memset(rcd, 0, sizeof(*rcd)); in erst_writer()
1141 memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); in erst_writer()
1142 rcd->hdr.revision = CPER_RECORD_REV; in erst_writer()
1143 rcd->hdr.signature_end = CPER_SIG_END; in erst_writer()
1144 rcd->hdr.section_count = 1; in erst_writer()
1145 rcd->hdr.error_severity = CPER_SEV_FATAL; in erst_writer()
1147 rcd->hdr.validation_bits = CPER_VALID_TIMESTAMP; in erst_writer()
1148 rcd->hdr.timestamp = ktime_get_real_seconds(); in erst_writer()
1149 rcd->hdr.record_length = sizeof(*rcd) + record->size; in erst_writer()
1150 rcd->hdr.creator_id = CPER_CREATOR_PSTORE; in erst_writer()
1151 rcd->hdr.notification_type = CPER_NOTIFY_MCE; in erst_writer()
1152 rcd->hdr.record_id = cper_next_record_id(); in erst_writer()
1153 rcd->hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; in erst_writer()
1155 rcd->sec_hdr.section_offset = sizeof(*rcd); in erst_writer()
1156 rcd->sec_hdr.section_length = record->size; in erst_writer()
1157 rcd->sec_hdr.revision = CPER_SEC_REV; in erst_writer()
1159 rcd->sec_hdr.validation_bits = 0; in erst_writer()
1160 rcd->sec_hdr.flags = CPER_SEC_PRIMARY; in erst_writer()
1164 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG_Z; in erst_writer()
1166 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG; in erst_writer()
1169 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE; in erst_writer()
1174 rcd->sec_hdr.section_severity = CPER_SEV_FATAL; in erst_writer()
1176 ret = erst_write(&rcd->hdr); in erst_writer()
1177 record->id = rcd->hdr.record_id; in erst_writer()