]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use named constant for reserved device space
authorQu Wenruo <wqu@suse.com>
Mon, 13 Jun 2022 07:06:34 +0000 (15:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:36 +0000 (17:45 +0200)
commite6aefddb11019aa4201864c5ac6db88fad0ba49e
tree45bf2097d56215c00b0ca9766e3e878ca4d989c7
parent78b8e1a2349c704e87708e97c5f1652d456c3826
btrfs: use named constant for reserved device space

There's a reserved space on each device of size 1MiB that can be used by
bootloaders or to avoid accidental overwrite. Use a symbolic constant
with the explaining comment instead of hard coding the value and
multiple comments.

Note: since btrfs-progs v4.1, mkfs.btrfs will reserve the first 1MiB for
the primary super block (at offset 64KiB), until then the range could
have been used by mistake. Kernel has been always respecting the 1MiB
range for writes.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/super.c
fs/btrfs/volumes.c