X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=fs%2Fpstore%2Fram.c;h=c4baf696eaa2f50dc13f97cb6f92ccdedf593862;hb=c844b643eff9f140a03e8466295b474d61f8afeb;hp=22ffa28aa2dc1150e333d5016f00172505851e48;hpb=faef33153ff39cd8aa45bd66cf54db0dca1091be;p=android-x86%2Fkernel.git diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 22ffa28aa2dc..c4baf696eaa2 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -331,6 +331,24 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type, return 0; } +static int notrace ramoops_pstore_write_buf_user(enum pstore_type_id type, + enum kmsg_dump_reason reason, + u64 *id, unsigned int part, + const char __user *buf, + bool compressed, size_t size, + struct pstore_info *psi) +{ + if (type == PSTORE_TYPE_PMSG) { + struct ramoops_context *cxt = psi->data; + + if (!cxt->mprz) + return -ENOMEM; + return persistent_ram_write_user(cxt->mprz, buf, size); + } + + return -EINVAL; +} + static int ramoops_pstore_erase(enum pstore_type_id type, u64 id, int count, struct timespec time, struct pstore_info *psi) { @@ -369,6 +387,7 @@ static struct ramoops_context oops_cxt = { .open = ramoops_pstore_open, .read = ramoops_pstore_read, .write_buf = ramoops_pstore_write_buf, + .write_buf_user = ramoops_pstore_write_buf_user, .erase = ramoops_pstore_erase, }, };