linux-stable/fs/efivarfs
Anisse Astier d86ff3333c efivarfs: expose used and total size
When writing EFI variables, one might get errors with no other message
on why it fails. Being able to see how much is used by EFI variables
helps analyzing such issues.

Since this is not a conventional filesystem, block size is intentionally
set to 1 instead of PAGE_SIZE.

x86 quirks of reserved size are taken into account; so that available
and free size can be different, further helping debugging space issues.

With this patch, one can see the remaining space in EFI variable storage
via efivarfs, like this:

   $ df -h /sys/firmware/efi/efivars/
   Filesystem      Size  Used Avail Use% Mounted on
   efivarfs        176K  106K   66K  62% /sys/firmware/efi/efivars

Signed-off-by: Anisse Astier <an.astier@criteo.com>
[ardb: - rename efi_reserved_space() to efivar_reserved_space()
       - whitespace/coding style tweaks]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2023-05-17 18:21:34 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
file.c efivars: convert to fileattr 2021-04-12 15:04:29 +02:00
inode.c fs: port ->fileattr_set() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
internal.h efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
super.c efivarfs: expose used and total size 2023-05-17 18:21:34 +02:00
vars.c efi: efivars: Fix variable writes without query_variable_store() 2022-10-21 11:09:40 +02:00