From 3d6d8d20ec4fd3b256632edb373a9c504724b8a9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Thu, 17 Nov 2011 13:13:29 -0800 Subject: 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 Signed-off-by: Tony Luck --- fs/pstore/platform.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'fs/pstore') diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 57bbf9078ac8..f146d89179bf 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -122,7 +122,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, memcpy(dst, s1 + s1_start, l1_cpy); memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); - ret = psinfo->write(PSTORE_TYPE_DMESG, &id, part, + ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, hsize + l1_cpy + l2_cpy, psinfo); if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) pstore_new_entry = 1; @@ -243,33 +243,5 @@ static void pstore_timefunc(unsigned long dummy) mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL); } -/* - * Call platform driver to write a record to the - * persistent store. - */ -int pstore_write(enum pstore_type_id type, char *buf, size_t size) -{ - u64 id; - int ret; - unsigned long flags; - - if (!psinfo) - return -ENODEV; - - if (size > psinfo->bufsize) - return -EFBIG; - - spin_lock_irqsave(&psinfo->buf_lock, flags); - memcpy(psinfo->buf, buf, size); - ret = psinfo->write(type, &id, 0, size, psinfo); - if (ret == 0 && pstore_is_mounted()) - pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, psinfo->buf, - size, CURRENT_TIME, psinfo); - spin_unlock_irqrestore(&psinfo->buf_lock, flags); - - return 0; -} -EXPORT_SYMBOL_GPL(pstore_write); - module_param(backend, charp, 0444); MODULE_PARM_DESC(backend, "Pstore backend to use"); -- cgit v1.2.3-59-g8ed1b