diff options
-rw-r--r-- | drivers/acpi/apei/erst.c | 10 | ||||
-rw-r--r-- | fs/pstore/inode.c | 6 | ||||
-rw-r--r-- | fs/pstore/platform.c | 9 | ||||
-rw-r--r-- | include/linux/pstore.h | 5 |
4 files changed, 18 insertions, 12 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index de3ae92adaa5..d842ac4f8cfe 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
@@ -933,9 +933,10 @@ static int erst_open_pstore(struct pstore_info *psi); | |||
933 | static int erst_close_pstore(struct pstore_info *psi); | 933 | static int erst_close_pstore(struct pstore_info *psi); |
934 | static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, | 934 | static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, |
935 | struct timespec *time, struct pstore_info *psi); | 935 | struct timespec *time, struct pstore_info *psi); |
936 | static u64 erst_writer(enum pstore_type_id type, size_t size, | 936 | static u64 erst_writer(enum pstore_type_id type, int part, size_t size, |
937 | struct pstore_info *psi); | 937 | struct pstore_info *psi); |
938 | static int erst_clearer(u64 id, struct pstore_info *psi); | 938 | static int erst_clearer(enum pstore_type_id type, u64 id, |
939 | struct pstore_info *psi); | ||
939 | 940 | ||
940 | static struct pstore_info erst_info = { | 941 | static struct pstore_info erst_info = { |
941 | .owner = THIS_MODULE, | 942 | .owner = THIS_MODULE, |
@@ -1039,7 +1040,7 @@ out: | |||
1039 | return (rc < 0) ? rc : (len - sizeof(*rcd)); | 1040 | return (rc < 0) ? rc : (len - sizeof(*rcd)); |
1040 | } | 1041 | } |
1041 | 1042 | ||
1042 | static u64 erst_writer(enum pstore_type_id type, size_t size, | 1043 | static u64 erst_writer(enum pstore_type_id type, int part, size_t size, |
1043 | struct pstore_info *psi) | 1044 | struct pstore_info *psi) |
1044 | { | 1045 | { |
1045 | struct cper_pstore_record *rcd = (struct cper_pstore_record *) | 1046 | struct cper_pstore_record *rcd = (struct cper_pstore_record *) |
@@ -1083,7 +1084,8 @@ static u64 erst_writer(enum pstore_type_id type, size_t size, | |||
1083 | return rcd->hdr.record_id; | 1084 | return rcd->hdr.record_id; |
1084 | } | 1085 | } |
1085 | 1086 | ||
1086 | static int erst_clearer(u64 id, struct pstore_info *psi) | 1087 | static int erst_clearer(enum pstore_type_id type, u64 id, |
1088 | struct pstore_info *psi) | ||
1087 | { | 1089 | { |
1088 | return erst_clear(id); | 1090 | return erst_clear(id); |
1089 | } | 1091 | } |
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index b19884a1ba77..893b961dcfd8 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -39,8 +39,9 @@ | |||
39 | #define PSTORE_NAMELEN 64 | 39 | #define PSTORE_NAMELEN 64 |
40 | 40 | ||
41 | struct pstore_private { | 41 | struct pstore_private { |
42 | u64 id; | ||
43 | struct pstore_info *psi; | 42 | struct pstore_info *psi; |
43 | enum pstore_type_id type; | ||
44 | u64 id; | ||
44 | ssize_t size; | 45 | ssize_t size; |
45 | char data[]; | 46 | char data[]; |
46 | }; | 47 | }; |
@@ -73,7 +74,7 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry) | |||
73 | { | 74 | { |
74 | struct pstore_private *p = dentry->d_inode->i_private; | 75 | struct pstore_private *p = dentry->d_inode->i_private; |
75 | 76 | ||
76 | p->psi->erase(p->id, p->psi); | 77 | p->psi->erase(p->type, p->id, p->psi); |
77 | 78 | ||
78 | return simple_unlink(dir, dentry); | 79 | return simple_unlink(dir, dentry); |
79 | } | 80 | } |
@@ -192,6 +193,7 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, | |||
192 | private = kmalloc(sizeof *private + size, GFP_KERNEL); | 193 | private = kmalloc(sizeof *private + size, GFP_KERNEL); |
193 | if (!private) | 194 | if (!private) |
194 | goto fail_alloc; | 195 | goto fail_alloc; |
196 | private->type = type; | ||
195 | private->id = id; | 197 | private->id = id; |
196 | private->psi = psi; | 198 | private->psi = psi; |
197 | 199 | ||
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); |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index b2f1d97f6909..12be8f193d09 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -39,9 +39,10 @@ struct pstore_info { | |||
39 | int (*close)(struct pstore_info *psi); | 39 | int (*close)(struct pstore_info *psi); |
40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
41 | struct timespec *time, struct pstore_info *psi); | 41 | struct timespec *time, struct pstore_info *psi); |
42 | u64 (*write)(enum pstore_type_id type, size_t size, | 42 | u64 (*write)(enum pstore_type_id type, int part, |
43 | size_t size, struct pstore_info *psi); | ||
44 | int (*erase)(enum pstore_type_id type, u64 id, | ||
43 | struct pstore_info *psi); | 45 | struct pstore_info *psi); |
44 | int (*erase)(u64 id, struct pstore_info *psi); | ||
45 | void *data; | 46 | void *data; |
46 | }; | 47 | }; |
47 | 48 | ||