diff --git a/ras-diskerror-handler.c b/ras-diskerror-handler.c index 38d0a36c..3150b325 100644 --- a/ras-diskerror-handler.c +++ b/ras-diskerror-handler.c @@ -31,6 +31,17 @@ #include "ras-report.h" +#define KERNEL_DEVICE_ID_BITS 20 +#define KERNEL_DEVICE_ID_MASK ((1U << KERNEL_DEVICE_ID_BITS) - 1) +static unsigned int major(dev_t devid) +{ + return (unsigned int)(devid >> KERNEL_DEVICE_ID_BITS); +} +static unsigned int minor(dev_t devid) +{ + return (unsigned int)(devid & KERNEL_DEVICE_ID_MASK); +} + static const struct { int error; const char *name;