diff options
Diffstat (limited to 'fs/pstore/inode.c')
-rw-r--r-- | fs/pstore/inode.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 977ed2723845..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 | struct pstore_info *psi; | ||
43 | enum pstore_type_id type; | ||
42 | u64 id; | 44 | u64 id; |
43 | int (*erase)(u64); | ||
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->erase(p->id); | 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 | } |
@@ -175,8 +176,8 @@ int pstore_is_mounted(void) | |||
175 | * Set the mtime & ctime to the date that this record was originally stored. | 176 | * Set the mtime & ctime to the date that this record was originally stored. |
176 | */ | 177 | */ |
177 | int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, | 178 | int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, |
178 | char *data, size_t size, | 179 | char *data, size_t size, struct timespec time, |
179 | struct timespec time, int (*erase)(u64)) | 180 | struct pstore_info *psi) |
180 | { | 181 | { |
181 | struct dentry *root = pstore_sb->s_root; | 182 | struct dentry *root = pstore_sb->s_root; |
182 | struct dentry *dentry; | 183 | struct dentry *dentry; |
@@ -192,8 +193,9 @@ 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->erase = erase; | 198 | private->psi = psi; |
197 | 199 | ||
198 | switch (type) { | 200 | switch (type) { |
199 | case PSTORE_TYPE_DMESG: | 201 | case PSTORE_TYPE_DMESG: |