Blame SOURCES/0002-major-minor-macros.patch

2ee3d8
From f5585f5839b51e734d28059f8a6b6d92ce036d93 Mon Sep 17 00:00:00 2001
2ee3d8
From: Vojtech Trefny <vtrefny@redhat.com>
2ee3d8
Date: Mon, 17 Dec 2018 10:36:49 +0100
2ee3d8
Subject: [PATCH] Use major/minor macros from sys/sysmacros.h instead of
2ee3d8
 linux/kdev_t.h
2ee3d8
2ee3d8
The macros from linux/kdev_t.h don't work for devices with
2ee3d8
minor > 255.
2ee3d8
2ee3d8
Resolves: rhbz#1644825
2ee3d8
---
2ee3d8
 src/plugins/mpath.c | 14 +++++++-------
2ee3d8
 1 file changed, 7 insertions(+), 7 deletions(-)
2ee3d8
2ee3d8
diff --git a/src/plugins/mpath.c b/src/plugins/mpath.c
2ee3d8
index 4fb75849..639c00b9 100644
2ee3d8
--- a/src/plugins/mpath.c
2ee3d8
+++ b/src/plugins/mpath.c
2ee3d8
@@ -18,8 +18,8 @@
2ee3d8
  */
2ee3d8
 
2ee3d8
 #include <glib.h>
2ee3d8
-/* provides MAJOR, MINOR macros */
2ee3d8
-#include <linux/kdev_t.h>
2ee3d8
+/* provides major and minor macros */
2ee3d8
+#include <sys/sysmacros.h>
2ee3d8
 #include <libdevmapper.h>
2ee3d8
 #include <unistd.h>
2ee3d8
 #include <blockdev/utils.h>
2ee3d8
@@ -273,8 +273,8 @@ static gboolean map_is_multipath (const gchar *map_name, GError **error) {
2ee3d8
 static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **error) {
2ee3d8
     struct dm_task *task;
2ee3d8
     struct dm_deps *deps;
2ee3d8
-    guint64 major = 0;
2ee3d8
-    guint64 minor = 0;
2ee3d8
+    guint64 dev_major = 0;
2ee3d8
+    guint64 dev_minor = 0;
2ee3d8
     guint64 i = 0;
2ee3d8
     gchar **dep_devs = NULL;
2ee3d8
     gchar *major_minor = NULL;
2ee3d8
@@ -319,9 +319,9 @@ static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **er
2ee3d8
     dep_devs = g_new0 (gchar*, deps->count + 1);
2ee3d8
 
2ee3d8
     for (i = 0; i < deps->count; i++) {
2ee3d8
-        major = (guint64) MAJOR(deps->device[i]);
2ee3d8
-        minor = (guint64) MINOR(deps->device[i]);
2ee3d8
-        major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, major, minor);
2ee3d8
+        dev_major = (guint64) major (deps->device[i]);
2ee3d8
+        dev_minor = (guint64) minor (deps->device[i]);
2ee3d8
+        major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, dev_major, dev_minor);
2ee3d8
         dep_devs[i] = get_device_name (major_minor, error);
2ee3d8
         if (*error) {
2ee3d8
             g_prefix_error (error, "Failed to resolve '%s' to device name",