efi: Use a file local lock for efivars

This patch replaces the spinlock in the efivars struct with a single lock
for the whole vars.c file.  The goal of this lock is to protect concurrent
calls to efi variable services, registering and unregistering. This allows
us to register new efivars operations without having in-progress call.

Signed-off-by: Sylvain Chouleur <sylvain.chouleur@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
This commit is contained in:
Sylvain Chouleur
2016-07-15 21:36:29 +02:00
committed by Matt Fleming
parent 2ead3084e3
commit 217b27d467
2 changed files with 47 additions and 42 deletions

View File

@@ -1157,12 +1157,6 @@ struct efivar_operations {
};
struct efivars {
/*
* ->lock protects two things:
* 1) efivarfs_list and efivars_sysfs_list
* 2) ->ops calls
*/
spinlock_t lock;
struct kset *kset;
struct kobject *kobject;
const struct efivar_operations *ops;