summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-09 17:10:43 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-17 10:07:09 -0700
commitc2b7113261c5bb49031a15b833e59ea2d8ec4074 (patch)
tree88e1f754156739a337791ff4d445a6de7d7d4641 /fs/pstore
parent21f679404a0c28bd5b1b3aff2a7218bbff4cb43d (diff)
downloadlinux-3.10-c2b7113261c5bb49031a15b833e59ea2d8ec4074.tar.gz
linux-3.10-c2b7113261c5bb49031a15b833e59ea2d8ec4074.tar.bz2
linux-3.10-c2b7113261c5bb49031a15b833e59ea2d8ec4074.zip
pstore/ram: Convert to write_buf callback
Don't use pstore.buf directly, instead convert the code to write_buf callback which passes a pointer to a buffer as an argument. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index b39aebbaeb8..74f4111bd0d 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -170,11 +170,12 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz)
return len;
}
-static int ramoops_pstore_write(enum pstore_type_id type,
- enum kmsg_dump_reason reason,
- u64 *id,
- unsigned int part,
- size_t size, struct pstore_info *psi)
+
+static int ramoops_pstore_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)
{
struct ramoops_context *cxt = psi->data;
struct persistent_ram_zone *prz = cxt->przs[cxt->dump_write_cnt];
@@ -183,7 +184,7 @@ static int ramoops_pstore_write(enum pstore_type_id type,
if (type == PSTORE_TYPE_CONSOLE) {
if (!cxt->cprz)
return -ENOMEM;
- persistent_ram_write(cxt->cprz, cxt->pstore.buf, size);
+ persistent_ram_write(cxt->cprz, buf, size);
return 0;
}
@@ -212,7 +213,7 @@ static int ramoops_pstore_write(enum pstore_type_id type,
hlen = ramoops_write_kmsg_hdr(prz);
if (size + hlen > prz->buffer_size)
size = prz->buffer_size - hlen;
- persistent_ram_write(prz, cxt->pstore.buf, size);
+ persistent_ram_write(prz, buf, size);
cxt->dump_write_cnt = (cxt->dump_write_cnt + 1) % cxt->max_dump_cnt;
@@ -250,7 +251,7 @@ static struct ramoops_context oops_cxt = {
.name = "ramoops",
.open = ramoops_pstore_open,
.read = ramoops_pstore_read,
- .write = ramoops_pstore_write,
+ .write_buf = ramoops_pstore_write_buf,
.erase = ramoops_pstore_erase,
},
};