multipath: Use standard 'major' macro
authorHannes Reinecke <hare@suse.de>
Tue, 29 Jul 2014 09:16:33 +0000 (11:16 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 16:02:55 +0000 (18:02 +0200)
Instead of carrying our own hand-crafted macros we should be using
the system-provided 'major' macro.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipath/dev_t.h [deleted file]
multipath/main.c

diff --git a/multipath/dev_t.h b/multipath/dev_t.h
deleted file mode 100644 (file)
index aa80d5e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#define MAJOR(dev)      ((dev & 0xfff00) >> 8)
-#define MINOR(dev)      ((dev & 0xff) | ((dev >> 12) & 0xfff00))
-#define MKDEV(ma,mi)    ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
index ce8fb5b..1c1191a 100644 (file)
@@ -57,7 +57,6 @@
 #include <sys/resource.h>
 #include <wwids.h>
 #include <uxsock.h>
-#include "dev_t.h"
 
 int logsink;
 
@@ -454,7 +453,7 @@ get_dev_type(char *dev) {
        int i;
 
        if (stat(dev, &buf) == 0 && S_ISBLK(buf.st_mode)) {
-               if (dm_is_dm_major(MAJOR(buf.st_rdev)))
+               if (dm_is_dm_major(major(buf.st_rdev)))
                        return DEV_DEVMAP;
                return DEV_DEVNODE;
        }