]> git.ipfire.org Git - thirdparty/grub.git/commit
osdep/linux/hostdisk: Use stat() instead of udevadm for partition lookup
authorJeff Mahoney <jeffm@suse.com>
Thu, 15 Jul 2021 15:35:28 +0000 (17:35 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 22 Jul 2021 13:57:37 +0000 (15:57 +0200)
commit1ea4e5ef09c06552402bf676ce262a661372f08d
tree4950b1554a9cfe97d1b7ebe02f7ebc29d7579a6f
parente94b4f23277f7572aacbbeae50b8927e03be148a
osdep/linux/hostdisk: Use stat() instead of udevadm for partition lookup

The sysfs_partition_path() calls udevadm to resolve the sysfs path for
a block device. That can be accomplished by stating the device node
and using the major/minor to follow the symlinks in /sys/dev/block/.

This cuts the execution time of grub-mkconfig to somewhere near 55% on
system without LVM (which uses libdevmapper instead sysfs_partition_path()).

Remove udevadm call as it does not help us more than calling stat() directly.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/osdep/linux/hostdisk.c