diff options
author | Kees Cook <keescook@chromium.org> | 2011-11-17 16:13:29 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-11-17 16:13:29 -0500 |
commit | 3d6d8d20ec4fd3b256632edb373a9c504724b8a9 (patch) | |
tree | 6bb1a530bb50fcdb24a2db48d095480e741ae371 /drivers | |
parent | f6f8285132907757ef84ef8dae0a1244b8cde6ac (diff) |
pstore: pass reason to backend write callback
This allows a backend to filter on the dmesg reason as well as the pstore
reason. When ramoops is switched to pstore, this is needed since it has
no interest in storing non-crash dmesg details.
Drop pstore_write() as it has no users, and handling the "reason" here
has no obviously correct value.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/apei/erst.c | 6 | ||||
-rw-r--r-- | drivers/firmware/efivars.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 631b9477b99..6a9e3bad13f 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
@@ -934,7 +934,8 @@ static int erst_close_pstore(struct pstore_info *psi); | |||
934 | static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, | 934 | static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, |
935 | struct timespec *time, char **buf, | 935 | struct timespec *time, char **buf, |
936 | struct pstore_info *psi); | 936 | struct pstore_info *psi); |
937 | static int erst_writer(enum pstore_type_id type, u64 *id, unsigned int part, | 937 | static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, |
938 | u64 *id, unsigned int part, | ||
938 | size_t size, struct pstore_info *psi); | 939 | size_t size, struct pstore_info *psi); |
939 | static int erst_clearer(enum pstore_type_id type, u64 id, | 940 | static int erst_clearer(enum pstore_type_id type, u64 id, |
940 | struct pstore_info *psi); | 941 | struct pstore_info *psi); |
@@ -1053,7 +1054,8 @@ out: | |||
1053 | return (rc < 0) ? rc : (len - sizeof(*rcd)); | 1054 | return (rc < 0) ? rc : (len - sizeof(*rcd)); |
1054 | } | 1055 | } |
1055 | 1056 | ||
1056 | static int erst_writer(enum pstore_type_id type, u64 *id, unsigned int part, | 1057 | static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, |
1058 | u64 *id, unsigned int part, | ||
1057 | size_t size, struct pstore_info *psi) | 1059 | size_t size, struct pstore_info *psi) |
1058 | { | 1060 | { |
1059 | struct cper_pstore_record *rcd = (struct cper_pstore_record *) | 1061 | struct cper_pstore_record *rcd = (struct cper_pstore_record *) |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index a54a6b972ce..0a53a05a850 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -495,7 +495,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, | |||
495 | return 0; | 495 | return 0; |
496 | } | 496 | } |
497 | 497 | ||
498 | static int efi_pstore_write(enum pstore_type_id type, u64 *id, | 498 | static int efi_pstore_write(enum pstore_type_id type, |
499 | enum kmsg_dump_reason reason, u64 *id, | ||
499 | unsigned int part, size_t size, struct pstore_info *psi) | 500 | unsigned int part, size_t size, struct pstore_info *psi) |
500 | { | 501 | { |
501 | char name[DUMP_NAME_LEN]; | 502 | char name[DUMP_NAME_LEN]; |
@@ -565,7 +566,7 @@ static int efi_pstore_write(enum pstore_type_id type, u64 *id, | |||
565 | static int efi_pstore_erase(enum pstore_type_id type, u64 id, | 566 | static int efi_pstore_erase(enum pstore_type_id type, u64 id, |
566 | struct pstore_info *psi) | 567 | struct pstore_info *psi) |
567 | { | 568 | { |
568 | efi_pstore_write(type, &id, (unsigned int)id, 0, psi); | 569 | efi_pstore_write(type, 0, &id, (unsigned int)id, 0, psi); |
569 | 570 | ||
570 | return 0; | 571 | return 0; |
571 | } | 572 | } |
@@ -586,7 +587,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type, | |||
586 | return -1; | 587 | return -1; |
587 | } | 588 | } |
588 | 589 | ||
589 | static int efi_pstore_write(enum pstore_type_id type, u64 *id, | 590 | static int efi_pstore_write(enum pstore_type_id type, |
591 | enum kmsg_dump_reason reason, u64 *id, | ||
590 | unsigned int part, size_t size, struct pstore_info *psi) | 592 | unsigned int part, size_t size, struct pstore_info *psi) |
591 | { | 593 | { |
592 | return 0; | 594 | return 0; |