Commit 85974825 authored by Ard Biesheuvel's avatar Ard Biesheuvel

efi: pstore: Omit efivars caching EFI varstore access layer

Avoid the efivars layer and simply call the newly introduced EFI
varstore helpers instead. This simplifies the code substantially, and
also allows us to remove some hacks in the shared efivars layer that
were added for efi-pstore specifically.

In order to be able to delete the EFI variable associated with a record,
store the UTF-16 name of the variable in the pstore record's priv field.
That way, we don't have to make guesses regarding which variable the
record may have been loaded from.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 472831d4
......@@ -22,6 +22,7 @@ config EFI_ESRT
config EFI_VARS_PSTORE
tristate "Register efivars backend for pstore"
depends on PSTORE
select UCS2_STRING
default y
help
Say Y here to enable use efivars as a backend to pstore. This
......
This diff is collapsed.
......@@ -467,16 +467,12 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj,
else if (__efivar_entry_delete(entry))
err = -EIO;
if (err) {
efivar_entry_iter_end();
efivar_entry_iter_end();
if (err)
return err;
}
if (!entry->scanning) {
efivar_entry_iter_end();
efivar_unregister(entry);
} else
efivar_entry_iter_end();
efivar_unregister(entry);
/* It's dead Jim.... */
return count;
......
......@@ -821,16 +821,8 @@ struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid,
if (!found)
return NULL;
if (remove) {
if (entry->scanning) {
/*
* The entry will be deleted
* after scanning is completed.
*/
entry->deleting = true;
} else
list_del(&entry->list);
}
if (remove)
list_del(&entry->list);
return entry;
}
......
......@@ -1043,8 +1043,6 @@ struct efivar_entry {
struct efi_variable var;
struct list_head list;
struct kobject kobj;
bool scanning;
bool deleting;
};
static inline void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment