diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 12:31:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 12:31:00 -0400 |
commit | bcc66c0b8881f88459f9ac21038455bcafacdc6e (patch) | |
tree | b402e677253c3fc1038ca4a52fc54fc223261133 /fs/pstore | |
parent | 1c1b86215730ef07d8851c2247b9ecf73038d05d (diff) | |
parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) |
Merge 3.5-rc4 into staging-next
This picks up the staging changes made in 3.5-rc4 so that everyone can sync up
properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/platform.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index be4614f24a2f..6b3ff045fe6e 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -102,20 +102,15 @@ static const char *get_reason_str(enum kmsg_dump_reason reason) | |||
102 | * as we can from the end of the buffer. | 102 | * as we can from the end of the buffer. |
103 | */ | 103 | */ |
104 | static void pstore_dump(struct kmsg_dumper *dumper, | 104 | static void pstore_dump(struct kmsg_dumper *dumper, |
105 | enum kmsg_dump_reason reason, | 105 | enum kmsg_dump_reason reason) |
106 | const char *s1, unsigned long l1, | ||
107 | const char *s2, unsigned long l2) | ||
108 | { | 106 | { |
109 | unsigned long s1_start, s2_start; | 107 | unsigned long total = 0; |
110 | unsigned long l1_cpy, l2_cpy; | ||
111 | unsigned long size, total = 0; | ||
112 | char *dst; | ||
113 | const char *why; | 108 | const char *why; |
114 | u64 id; | 109 | u64 id; |
115 | int hsize, ret; | ||
116 | unsigned int part = 1; | 110 | unsigned int part = 1; |
117 | unsigned long flags = 0; | 111 | unsigned long flags = 0; |
118 | int is_locked = 0; | 112 | int is_locked = 0; |
113 | int ret; | ||
119 | 114 | ||
120 | why = get_reason_str(reason); | 115 | why = get_reason_str(reason); |
121 | 116 | ||
@@ -127,30 +122,25 @@ static void pstore_dump(struct kmsg_dumper *dumper, | |||
127 | spin_lock_irqsave(&psinfo->buf_lock, flags); | 122 | spin_lock_irqsave(&psinfo->buf_lock, flags); |
128 | oopscount++; | 123 | oopscount++; |
129 | while (total < kmsg_bytes) { | 124 | while (total < kmsg_bytes) { |
125 | char *dst; | ||
126 | unsigned long size; | ||
127 | int hsize; | ||
128 | size_t len; | ||
129 | |||
130 | dst = psinfo->buf; | 130 | dst = psinfo->buf; |
131 | hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part); | 131 | hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part); |
132 | size = psinfo->bufsize - hsize; | 132 | size = psinfo->bufsize - hsize; |
133 | dst += hsize; | 133 | dst += hsize; |
134 | 134 | ||
135 | l2_cpy = min(l2, size); | 135 | if (!kmsg_dump_get_buffer(dumper, true, dst, size, &len)) |
136 | l1_cpy = min(l1, size - l2_cpy); | ||
137 | |||
138 | if (l1_cpy + l2_cpy == 0) | ||
139 | break; | 136 | break; |
140 | 137 | ||
141 | s2_start = l2 - l2_cpy; | ||
142 | s1_start = l1 - l1_cpy; | ||
143 | |||
144 | memcpy(dst, s1 + s1_start, l1_cpy); | ||
145 | memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); | ||
146 | |||
147 | ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, | 138 | ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, |
148 | hsize + l1_cpy + l2_cpy, psinfo); | 139 | hsize + len, psinfo); |
149 | if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) | 140 | if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) |
150 | pstore_new_entry = 1; | 141 | pstore_new_entry = 1; |
151 | l1 -= l1_cpy; | 142 | |
152 | l2 -= l2_cpy; | 143 | total += hsize + len; |
153 | total += l1_cpy + l2_cpy; | ||
154 | part++; | 144 | part++; |
155 | } | 145 | } |
156 | if (in_nmi()) { | 146 | if (in_nmi()) { |