diff options
Diffstat (limited to 'fs/pstore/platform.c')
| -rw-r--r-- | fs/pstore/platform.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 86d1038b5a12..422962ae9fc2 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
| @@ -159,7 +159,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, | |||
| 159 | break; | 159 | break; |
| 160 | 160 | ||
| 161 | ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, | 161 | ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, |
| 162 | oopscount, hsize + len, psinfo); | 162 | oopscount, hsize, hsize + len, psinfo); |
| 163 | if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) | 163 | if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) |
| 164 | pstore_new_entry = 1; | 164 | pstore_new_entry = 1; |
| 165 | 165 | ||
| @@ -196,7 +196,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) | |||
| 196 | spin_lock_irqsave(&psinfo->buf_lock, flags); | 196 | spin_lock_irqsave(&psinfo->buf_lock, flags); |
| 197 | } | 197 | } |
| 198 | memcpy(psinfo->buf, s, c); | 198 | memcpy(psinfo->buf, s, c); |
| 199 | psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, 0, c, psinfo); | 199 | psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, 0, 0, c, psinfo); |
| 200 | spin_unlock_irqrestore(&psinfo->buf_lock, flags); | 200 | spin_unlock_irqrestore(&psinfo->buf_lock, flags); |
| 201 | s += c; | 201 | s += c; |
| 202 | c = e - s; | 202 | c = e - s; |
| @@ -221,9 +221,11 @@ static void pstore_register_console(void) {} | |||
| 221 | static int pstore_write_compat(enum pstore_type_id type, | 221 | static int pstore_write_compat(enum pstore_type_id type, |
| 222 | enum kmsg_dump_reason reason, | 222 | enum kmsg_dump_reason reason, |
| 223 | u64 *id, unsigned int part, int count, | 223 | u64 *id, unsigned int part, int count, |
| 224 | size_t size, struct pstore_info *psi) | 224 | size_t hsize, size_t size, |
| 225 | struct pstore_info *psi) | ||
| 225 | { | 226 | { |
| 226 | return psi->write_buf(type, reason, id, part, psinfo->buf, size, psi); | 227 | return psi->write_buf(type, reason, id, part, psinfo->buf, hsize, |
| 228 | size, psi); | ||
| 227 | } | 229 | } |
| 228 | 230 | ||
| 229 | /* | 231 | /* |
| @@ -239,17 +241,15 @@ int pstore_register(struct pstore_info *psi) | |||
| 239 | { | 241 | { |
| 240 | struct module *owner = psi->owner; | 242 | struct module *owner = psi->owner; |
| 241 | 243 | ||
| 244 | if (backend && strcmp(backend, psi->name)) | ||
| 245 | return -EPERM; | ||
| 246 | |||
| 242 | spin_lock(&pstore_lock); | 247 | spin_lock(&pstore_lock); |
| 243 | if (psinfo) { | 248 | if (psinfo) { |
| 244 | spin_unlock(&pstore_lock); | 249 | spin_unlock(&pstore_lock); |
| 245 | return -EBUSY; | 250 | return -EBUSY; |
| 246 | } | 251 | } |
| 247 | 252 | ||
| 248 | if (backend && strcmp(backend, psi->name)) { | ||
| 249 | spin_unlock(&pstore_lock); | ||
| 250 | return -EINVAL; | ||
| 251 | } | ||
| 252 | |||
| 253 | if (!psi->write) | 253 | if (!psi->write) |
| 254 | psi->write = pstore_write_compat; | 254 | psi->write = pstore_write_compat; |
| 255 | psinfo = psi; | 255 | psinfo = psi; |
| @@ -274,6 +274,9 @@ int pstore_register(struct pstore_info *psi) | |||
| 274 | add_timer(&pstore_timer); | 274 | add_timer(&pstore_timer); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | pr_info("pstore: Registered %s as persistent store backend\n", | ||
| 278 | psi->name); | ||
| 279 | |||
| 277 | return 0; | 280 | return 0; |
| 278 | } | 281 | } |
| 279 | EXPORT_SYMBOL_GPL(pstore_register); | 282 | EXPORT_SYMBOL_GPL(pstore_register); |
