efivarfs: Move file system code to fs/efivarfs/

efivars.c has grown far too large and weighs in at nearly 2000
lines. It contains code for,

  * EFI variable handling at the firmware-level
  * handling EFI variables via sysfs
  * a pstore backend
  * an EFI variable filesystem

Start chainsawing things up now before it gets any worse. Move all the
efivarfs filesystem-specific code to fs/efivarfs/. This has
necessitated introducing an EFI variable interface in efivars.c, see
efivar_list_add() and efivar_list_del_unlock().

It also looks like efivarfs only ever worked with the CONFIG_EFI_VARS
backend, not CONFIG_GOOGLE_SMI, because it accesses '__efivars'
directly. Interestingly, if anyone was running with both of those
options enabled efivarfs would have been registered twice via
register_filesystem().

There's no reason that efivarfs couldn't be made to work with the
CONFIG_GOOGLE_SMI variable backend, apart from the fact that the
efivar code doesn't currently support such a scheme.

Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Mike Waychison <mikew@google.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
11 files changed