pstore: Populate pstore record->time field
The current time will be initially available in the record->time field for all pstore_read() and pstore_write() calls. Backends can either update the field during read(), or use the field during write() instead of fetching time themselves. Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
@@ -480,6 +480,12 @@ void pstore_record_init(struct pstore_record *record,
|
||||
memset(record, 0, sizeof(*record));
|
||||
|
||||
record->psi = psinfo;
|
||||
|
||||
/* Report zeroed timestamp if called before timekeeping has resumed. */
|
||||
if (__getnstimeofday(&record->time)) {
|
||||
record->time.tv_sec = 0;
|
||||
record->time.tv_nsec = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user