udev: use block_device_is_whole_disk()

No functional changes, just refactoring.

Note, this also makes synthesize_change() propagate the error from
synthesize_change_one(). However, the caller of synthesize_change()
ignores the failure anyway, hence the change does not take any effect.
This commit is contained in:
Yu Watanabe
2022-09-20 09:44:19 +02:00
committed by Daan De Meyer
parent 83b94cf10e
commit 2f9d231738
3 changed files with 30 additions and 37 deletions
+1
View File
@@ -14,6 +14,7 @@
#define xsprintf_sys_block_path(buf, suffix, devno) \
xsprintf(buf, "/sys/dev/block/%u:%u%s", major(devno), minor(devno), strempty(suffix))
int block_device_is_whole_disk(sd_device *dev);
int block_device_get_whole_disk(sd_device *dev, sd_device **ret);
int block_get_whole_disk(dev_t d, dev_t *ret);