diff options
author | Matthew Garrett | 2011-07-21 16:57:52 -0400 |
---|---|---|
committer | Tony Luck | 2011-07-22 16:14:06 -0700 |
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 @@ struct pstore_private { u64 id; - int (*erase)(u64); + struct pstore_info *psi; ssize_t size; char data[]; }; @@ -73,7 +73,7 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry) { struct pstore_private *p = dentry->d_inode->i_private; - p->erase(p->id); + p->psi->erase(p->id, p->psi); return simple_unlink(dir, dentry); } @@ -175,8 +175,8 @@ int pstore_is_mounted(void) * Set the mtime & ctime to the date that this record was originally stored. */ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, - char *data, size_t size, - struct timespec time, int (*erase)(u64)) + char *data, size_t size, struct timespec time, + struct pstore_info *psi) { struct dentry *root = pstore_sb->s_root; struct dentry *dentry; @@ -193,7 +193,7 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, if (!private) goto fail_alloc; private->id = id; - private->erase = erase; + private->psi = psi; switch (type) { case PSTORE_TYPE_DMESG: |