aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r--fs/pstore/platform.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 57bbf9078ac..f146d89179b 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -122,7 +122,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
122 memcpy(dst, s1 + s1_start, l1_cpy); 122 memcpy(dst, s1 + s1_start, l1_cpy);
123 memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); 123 memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);
124 124
125 ret = psinfo->write(PSTORE_TYPE_DMESG, &id, part, 125 ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part,
126 hsize + l1_cpy + l2_cpy, psinfo); 126 hsize + l1_cpy + l2_cpy, psinfo);
127 if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) 127 if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted())
128 pstore_new_entry = 1; 128 pstore_new_entry = 1;
@@ -243,33 +243,5 @@ static void pstore_timefunc(unsigned long dummy)
243 mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL); 243 mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL);
244} 244}
245 245
246/*
247 * Call platform driver to write a record to the
248 * persistent store.
249 */
250int pstore_write(enum pstore_type_id type, char *buf, size_t size)
251{
252 u64 id;
253 int ret;
254 unsigned long flags;
255
256 if (!psinfo)
257 return -ENODEV;
258
259 if (size > psinfo->bufsize)
260 return -EFBIG;
261
262 spin_lock_irqsave(&psinfo->buf_lock, flags);
263 memcpy(psinfo->buf, buf, size);
264 ret = psinfo->write(type, &id, 0, size, psinfo);
265 if (ret == 0 && pstore_is_mounted())
266 pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, psinfo->buf,
267 size, CURRENT_TIME, psinfo);
268 spin_unlock_irqrestore(&psinfo->buf_lock, flags);
269
270 return 0;
271}
272EXPORT_SYMBOL_GPL(pstore_write);
273
274module_param(backend, charp, 0444); 246module_param(backend, charp, 0444);
275MODULE_PARM_DESC(backend, "Pstore backend to use"); 247MODULE_PARM_DESC(backend, "Pstore backend to use");