]> git.ipfire.org Git - thirdparty/grub.git/commit
disk: Move hardcoded max disk size literal to a GRUB_DISK_MAX_SECTORS in disk.h
authorGlenn Washburn <development@efficientek.com>
Tue, 1 Dec 2020 05:16:19 +0000 (23:16 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sat, 12 Dec 2020 00:19:03 +0000 (01:19 +0100)
commit407ddead690ea76d63415f37deba9421b0bf5c13
tree94bf09f1fe0bfec4713000b95c418f415f7a9116
parent8919eecd84e1b8e2e139bfa9df061cc01fa49dd5
disk: Move hardcoded max disk size literal to a GRUB_DISK_MAX_SECTORS in disk.h

There is a hardcoded maximum disk size that can be read or written from,
currently set at 1 EiB in grub_disk_adjust_range(). Move the literal into a
macro in disk.h, so our assumptions are more visible. This hard coded limit
does not prevent using larger disks, just GRUB won't read/write past the
limit. The comment accompanying this restriction didn't quite make sense to
me, so its been modified too.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/disk_common.c
include/grub/disk.h