From 30d82fad552d924d03a991514935950878803784 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Mon, 9 Jul 2012 17:10:40 -0700 Subject: [PATCH] --- yaml --- r: 318016 b: refs/heads/master c: 897dba027445be93f40e5caf550556ca38c48c51 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/pstore/platform.c | 10 ++++++++++ trunk/include/linux/pstore.h | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 95045d1ef7b3..930ecd158541 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b2ad368bebc0f772613668e893fa176396e9094c +refs/heads/master: 897dba027445be93f40e5caf550556ca38c48c51 diff --git a/trunk/fs/pstore/platform.c b/trunk/fs/pstore/platform.c index 6b3ff045fe6e..ef5ca8a0255c 100644 --- a/trunk/fs/pstore/platform.c +++ b/trunk/fs/pstore/platform.c @@ -188,6 +188,14 @@ static void pstore_register_console(void) static void pstore_register_console(void) {} #endif +static int pstore_write_compat(enum pstore_type_id type, + enum kmsg_dump_reason reason, + u64 *id, unsigned int part, + size_t size, struct pstore_info *psi) +{ + return psi->write_buf(type, reason, id, part, psinfo->buf, size, psi); +} + /* * platform specific persistent storage driver registers with * us here. If pstore is already mounted, call the platform @@ -212,6 +220,8 @@ int pstore_register(struct pstore_info *psi) return -EINVAL; } + if (!psi->write) + psi->write = pstore_write_compat; psinfo = psi; mutex_init(&psinfo->read_mutex); spin_unlock(&pstore_lock); diff --git a/trunk/include/linux/pstore.h b/trunk/include/linux/pstore.h index 1bd014b8e432..b107484192fc 100644 --- a/trunk/include/linux/pstore.h +++ b/trunk/include/linux/pstore.h @@ -48,6 +48,10 @@ struct pstore_info { int (*write)(enum pstore_type_id type, enum kmsg_dump_reason reason, u64 *id, unsigned int part, size_t size, struct pstore_info *psi); + int (*write_buf)(enum pstore_type_id type, + enum kmsg_dump_reason reason, u64 *id, + unsigned int part, const char *buf, size_t size, + struct pstore_info *psi); int (*erase)(enum pstore_type_id type, u64 id, struct pstore_info *psi); void *data;