aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pstore/platform.c10
-rw-r--r--include/linux/pstore.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 6b3ff045fe6e..ef5ca8a0255c 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -188,6 +188,14 @@ static void pstore_register_console(void)
188static void pstore_register_console(void) {} 188static void pstore_register_console(void) {}
189#endif 189#endif
190 190
191static int pstore_write_compat(enum pstore_type_id type,
192 enum kmsg_dump_reason reason,
193 u64 *id, unsigned int part,
194 size_t size, struct pstore_info *psi)
195{
196 return psi->write_buf(type, reason, id, part, psinfo->buf, size, psi);
197}
198
191/* 199/*
192 * platform specific persistent storage driver registers with 200 * platform specific persistent storage driver registers with
193 * us here. If pstore is already mounted, call the platform 201 * us here. If pstore is already mounted, call the platform
@@ -212,6 +220,8 @@ int pstore_register(struct pstore_info *psi)
212 return -EINVAL; 220 return -EINVAL;
213 } 221 }
214 222
223 if (!psi->write)
224 psi->write = pstore_write_compat;
215 psinfo = psi; 225 psinfo = psi;
216 mutex_init(&psinfo->read_mutex); 226 mutex_init(&psinfo->read_mutex);
217 spin_unlock(&pstore_lock); 227 spin_unlock(&pstore_lock);
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 1bd014b8e432..b107484192fc 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -48,6 +48,10 @@ struct pstore_info {
48 int (*write)(enum pstore_type_id type, 48 int (*write)(enum pstore_type_id type,
49 enum kmsg_dump_reason reason, u64 *id, 49 enum kmsg_dump_reason reason, u64 *id,
50 unsigned int part, size_t size, struct pstore_info *psi); 50 unsigned int part, size_t size, struct pstore_info *psi);
51 int (*write_buf)(enum pstore_type_id type,
52 enum kmsg_dump_reason reason, u64 *id,
53 unsigned int part, const char *buf, size_t size,
54 struct pstore_info *psi);
51 int (*erase)(enum pstore_type_id type, u64 id, 55 int (*erase)(enum pstore_type_id type, u64 id,
52 struct pstore_info *psi); 56 struct pstore_info *psi);
53 void *data; 57 void *data;