diff options
author | Matthew Garrett <mjg@redhat.com> | 2011-07-21 16:57:52 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-07-22 19:14:06 -0400 |
commit | 638c1fd3033c76778e6d9975ad8a4a9cdd5b96d9 (patch) | |
tree | de8b772157162b8a7a0901f4df5fb25faef6b21d /fs/pstore/inode.c | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) |
pstore: Extend API for more flexibility in new backends
Some pstore implementations may not have a static context, so extend the
API to pass the pstore_info struct to all calls and allow for a context
pointer.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore/inode.c')
-rw-r--r-- | fs/pstore/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 977ed2723845..b19884a1ba77 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | struct pstore_private { | 41 | struct pstore_private { |
42 | u64 id; | 42 | u64 id; |
43 | int (*erase)(u64); | 43 | struct pstore_info *psi; |
44 | ssize_t size; | 44 | ssize_t size; |
45 | char data[]; | 45 | char data[]; |
46 | }; | 46 | }; |
@@ -73,7 +73,7 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry) | |||
73 | { | 73 | { |
74 | struct pstore_private *p = dentry->d_inode->i_private; | 74 | struct pstore_private *p = dentry->d_inode->i_private; |
75 | 75 | ||
76 | p->erase(p->id); | 76 | p->psi->erase(p->id, p->psi); |
77 | 77 | ||
78 | return simple_unlink(dir, dentry); | 78 | return simple_unlink(dir, dentry); |
79 | } | 79 | } |
@@ -175,8 +175,8 @@ int pstore_is_mounted(void) | |||
175 | * Set the mtime & ctime to the date that this record was originally stored. | 175 | * Set the mtime & ctime to the date that this record was originally stored. |
176 | */ | 176 | */ |
177 | int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, | 177 | int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, |
178 | char *data, size_t size, | 178 | char *data, size_t size, struct timespec time, |
179 | struct timespec time, int (*erase)(u64)) | 179 | struct pstore_info *psi) |
180 | { | 180 | { |
181 | struct dentry *root = pstore_sb->s_root; | 181 | struct dentry *root = pstore_sb->s_root; |
182 | struct dentry *dentry; | 182 | struct dentry *dentry; |
@@ -193,7 +193,7 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, | |||
193 | if (!private) | 193 | if (!private) |
194 | goto fail_alloc; | 194 | goto fail_alloc; |
195 | private->id = id; | 195 | private->id = id; |
196 | private->erase = erase; | 196 | private->psi = psi; |
197 | 197 | ||
198 | switch (type) { | 198 | switch (type) { |
199 | case PSTORE_TYPE_DMESG: | 199 | case PSTORE_TYPE_DMESG: |