diff options
author | Matthew Garrett <mjg@redhat.com> | 2011-07-21 16:57:53 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-07-22 19:14:20 -0400 |
commit | 56280682ceeef74b692b3e21d1872049eea7c887 (patch) | |
tree | 6d00729db23dff065ad60bf2f7be3f96b6fd4008 /fs/pstore/platform.c | |
parent | 638c1fd3033c76778e6d9975ad8a4a9cdd5b96d9 (diff) |
pstore: Add extra context for writes and erases
EFI only provides small amounts of individual storage, and conventionally
puts metadata in the storage variable name. Rather than add a metadata
header to the (already limited) variable storage, it's easier for us to
modify pstore to pass all the information we need to construct a unique
variable name to the appropriate functions.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r-- | fs/pstore/platform.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 221c04e5e333..163bb40511e7 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -78,7 +78,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, | |||
78 | oopscount++; | 78 | oopscount++; |
79 | while (total < kmsg_bytes) { | 79 | while (total < kmsg_bytes) { |
80 | dst = psinfo->buf; | 80 | dst = psinfo->buf; |
81 | hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part++); | 81 | hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part); |
82 | size = psinfo->bufsize - hsize; | 82 | size = psinfo->bufsize - hsize; |
83 | dst += hsize; | 83 | dst += hsize; |
84 | 84 | ||
@@ -94,8 +94,8 @@ static void pstore_dump(struct kmsg_dumper *dumper, | |||
94 | memcpy(dst, s1 + s1_start, l1_cpy); | 94 | memcpy(dst, s1 + s1_start, l1_cpy); |
95 | memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); | 95 | memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); |
96 | 96 | ||
97 | id = psinfo->write(PSTORE_TYPE_DMESG, hsize + l1_cpy + l2_cpy, | 97 | id = psinfo->write(PSTORE_TYPE_DMESG, part, |
98 | psinfo); | 98 | hsize + l1_cpy + l2_cpy, psinfo); |
99 | if (reason == KMSG_DUMP_OOPS && pstore_is_mounted()) | 99 | if (reason == KMSG_DUMP_OOPS && pstore_is_mounted()) |
100 | pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, | 100 | pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, |
101 | psinfo->buf, hsize + l1_cpy + l2_cpy, | 101 | psinfo->buf, hsize + l1_cpy + l2_cpy, |
@@ -103,6 +103,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, | |||
103 | l1 -= l1_cpy; | 103 | l1 -= l1_cpy; |
104 | l2 -= l2_cpy; | 104 | l2 -= l2_cpy; |
105 | total += l1_cpy + l2_cpy; | 105 | total += l1_cpy + l2_cpy; |
106 | part++; | ||
106 | } | 107 | } |
107 | mutex_unlock(&psinfo->buf_mutex); | 108 | mutex_unlock(&psinfo->buf_mutex); |
108 | } | 109 | } |
@@ -197,7 +198,7 @@ int pstore_write(enum pstore_type_id type, char *buf, size_t size) | |||
197 | 198 | ||
198 | mutex_lock(&psinfo->buf_mutex); | 199 | mutex_lock(&psinfo->buf_mutex); |
199 | memcpy(psinfo->buf, buf, size); | 200 | memcpy(psinfo->buf, buf, size); |
200 | id = psinfo->write(type, size, psinfo); | 201 | id = psinfo->write(type, 0, size, psinfo); |
201 | if (pstore_is_mounted()) | 202 | if (pstore_is_mounted()) |
202 | pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, psinfo->buf, | 203 | pstore_mkfile(PSTORE_TYPE_DMESG, psinfo->name, id, psinfo->buf, |
203 | size, CURRENT_TIME, psinfo); | 204 | size, CURRENT_TIME, psinfo); |