pstore: Add extra context for writes and erases

EFI only provides small amounts of individual storage, and conventionally
puts metadata in the storage variable name. Rather than add a metadata
header to the (already limited) variable storage, it's easier for us to
modify pstore to pass all the information we need to construct a unique
variable name to the appropriate functions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Matthew Garrett
2011-07-21 16:57:53 -04:00
committed by Tony Luck
parent 638c1fd303
commit 56280682ce
4 changed files with 18 additions and 12 deletions

View File

@@ -39,8 +39,9 @@
#define PSTORE_NAMELEN 64
struct pstore_private {
u64 id;
struct pstore_info *psi;
enum pstore_type_id type;
u64 id;
ssize_t size;
char data[];
};
@@ -73,7 +74,7 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
{
struct pstore_private *p = dentry->d_inode->i_private;
p->psi->erase(p->id, p->psi);
p->psi->erase(p->type, p->id, p->psi);
return simple_unlink(dir, dentry);
}
@@ -192,6 +193,7 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id,
private = kmalloc(sizeof *private + size, GFP_KERNEL);
if (!private)
goto fail_alloc;
private->type = type;
private->id = id;
private->psi = psi;