[priority] pp_sgi is actually a RDAC controller familly prioritizer
authorChristophe Varoqui <christophe.varoqui@free.fr>
Mon, 30 Jul 2007 21:36:57 +0000 (23:36 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Mon, 30 Jul 2007 21:36:57 +0000 (23:36 +0200)
So rename, as suggested by Hannes.

libmultipath/hwtable.c
multipath-tools.spec.in
multipath/multipath.conf.5
path_priority/pp_rdac/Makefile [new file with mode: 0644]
path_priority/pp_rdac/pp_rdac.c [new file with mode: 0644]
path_priority/pp_tpc/Makefile [deleted file]
path_priority/pp_tpc/pp_tpc.c [deleted file]

index 356e184..57874f6 100644 (file)
@@ -294,7 +294,7 @@ static struct hwentry default_hw[] = {
                .vendor        = "IBM",
                .product       = "1742",
                .getuid        = DEFAULT_GETUID,
-               .getprio       = "/sbin/mpath_prio_tpc /dev/%n",
+               .getprio       = "/sbin/mpath_prio_rdac /dev/%n",
                .features      = DEFAULT_FEATURES,
                .hwhandler     = DEFAULT_HWHANDLER,
                .selector      = DEFAULT_SELECTOR,
@@ -310,7 +310,7 @@ static struct hwentry default_hw[] = {
                .vendor        = "IBM",
                .product       = "3526",
                .getuid        = DEFAULT_GETUID,
-               .getprio       = "/sbin/mpath_prio_tpc /dev/%n",
+               .getprio       = "/sbin/mpath_prio_rdac /dev/%n",
                .features      = DEFAULT_FEATURES,
                .hwhandler     = DEFAULT_HWHANDLER,
                .selector      = DEFAULT_SELECTOR,
@@ -506,7 +506,7 @@ static struct hwentry default_hw[] = {
                .vendor        = "SGI",
                .product       = "TP9[45]00",
                .getuid        = DEFAULT_GETUID,
-               .getprio       = "/sbin/mpath_prio_tpc /dev/%n",
+               .getprio       = "/sbin/mpath_prio_rdac /dev/%n",
                .features      = DEFAULT_FEATURES,
                .hwhandler     = DEFAULT_HWHANDLER,
                .selector      = DEFAULT_SELECTOR,
@@ -521,7 +521,7 @@ static struct hwentry default_hw[] = {
                .vendor        = "SGI",
                .product       = "IS.*",
                .getuid        = DEFAULT_GETUID,
-               .getprio       = "/sbin/mpath_prio_tpc /dev/%n",
+               .getprio       = "/sbin/mpath_prio_rdac /dev/%n",
                .features      = DEFAULT_FEATURES,
                .hwhandler     = DEFAULT_HWHANDLER,
                .selector      = DEFAULT_SELECTOR,
@@ -542,7 +542,7 @@ static struct hwentry default_hw[] = {
                .vendor        = "STK",
                .product       = "OPENstorage D280",
                .getuid        = DEFAULT_GETUID,
-               .getprio       = "/sbin/mpath_prio_tpc /dev/%n",
+               .getprio       = "/sbin/mpath_prio_rdac /dev/%n",
                .features      = DEFAULT_FEATURES,
                .hwhandler     = DEFAULT_HWHANDLER,
                .selector      = DEFAULT_SELECTOR,
index 9d6a7ea..3caede6 100644 (file)
@@ -49,7 +49,7 @@ rm -rf $RPM_BUILD_ROOT
 %{prefix}/sbin/mpath_prio_random
 %{prefix}/sbin/mpath_prio_balance_units
 %{prefix}/sbin/mpath_prio_netapp
-%{prefix}/sbin/mpath_prio_tpc
+%{prefix}/sbin/mpath_prio_rdac
 %{prefix}/sbin/mpath_prio_hds_modular
 %{prefix}/usr/share/man/man8/devmap_name.8.gz
 %{prefix}/usr/share/man/man8/multipath.8.gz
index 905cb65..c8ab6b0 100644 (file)
@@ -133,7 +133,7 @@ Generate the path priority based on the SCSI-3 ALUA settings.
 .B mpath_prio_netapp /dev/%n
 Generate the path priority for NetApp arrays.
 .TP
-.B mpath_prio_tpc /dev/%n
+.B mpath_prio_rdac /dev/%n
 Generate the path priority for LSI/Engenio RDAC controller.
 .TP
 .B mpath_prio_hp_sw /dev/%n
diff --git a/path_priority/pp_rdac/Makefile b/path_priority/pp_rdac/Makefile
new file mode 100644 (file)
index 0000000..64ed4c3
--- /dev/null
@@ -0,0 +1,22 @@
+EXEC           = mpath_prio_rdac
+BUILD          = glibc
+OBJS           = pp_rdac.o
+
+TOPDIR         = ../..
+include $(TOPDIR)/Makefile.inc
+
+all: $(BUILD)
+
+glibc: $(OBJS)
+       $(CC) -o $(EXEC) $(OBJS) $(LDFLAGS)
+
+klibc: $(OBJS)
+       $(CC) -static -o $(EXEC) $(OBJS)
+
+install: $(EXEC)
+       $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+
+uninstall:
+       rm $(DESTDIR)$(bindir)/$(EXEC)
+clean: 
+       rm -f *.o $(EXEC)
diff --git a/path_priority/pp_rdac/pp_rdac.c b/path_priority/pp_rdac/pp_rdac.c
new file mode 100644 (file)
index 0000000..49a13cf
--- /dev/null
@@ -0,0 +1,112 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "../../libmultipath/sg_include.h"
+
+#define INQUIRY_CMD     0x12
+#define INQUIRY_CMDLEN  6
+
+int rdac_prio(const char *dev)
+{
+       unsigned char sense_buffer[256];
+       unsigned char sb[128];
+       unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC9, 0,
+                                               sizeof(sb), 0};
+       struct sg_io_hdr io_hdr;
+       int ret = 0;
+       int fd;
+
+       fd = open(dev, O_RDWR|O_NONBLOCK);
+
+       if (fd <= 0) {
+               fprintf(stderr, "opening of the device failed.\n");
+               goto out;
+       }
+
+       memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
+       io_hdr.interface_id = 'S';
+       io_hdr.cmd_len = sizeof (inqCmdBlk);
+       io_hdr.mx_sb_len = sizeof (sb);
+       io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
+       io_hdr.dxfer_len = sizeof (sense_buffer);
+       io_hdr.dxferp = sense_buffer;
+       io_hdr.cmdp = inqCmdBlk;
+       io_hdr.sbp = sb;
+       io_hdr.timeout = 60000;
+       io_hdr.pack_id = 0;
+       if (ioctl(fd, SG_IO, &io_hdr) < 0) {
+               fprintf(stderr, "sending inquiry command failed\n");
+               goto out;
+       }
+       if (io_hdr.info & SG_INFO_OK_MASK) {
+               fprintf(stderr, "inquiry command indicates error");
+               goto out;
+       }
+
+       close(fd);
+       
+       if (/* Verify the code page - right page & page identifier */
+           sense_buffer[1] != 0xc9 || 
+           sense_buffer[3] != 0x2c ||
+           sense_buffer[4] != 'v' ||
+           sense_buffer[5] != 'a' ||
+           sense_buffer[6] != 'c' ) {
+               fprintf(stderr, "Volume access control page in unknown format");
+               goto out;
+       }
+       
+       if ( /* Current Volume Path Bit */
+               ( sense_buffer[8] & 0x01) == 0x01 ) {
+               /* 
+                * This volume was owned by the controller receiving
+                * the inquiry command.
+                */
+               ret |= 0x01;
+       }
+
+       /* Volume Preferred Path Priority */
+       switch ( sense_buffer[9] & 0x0F ) {
+       case 0x01:
+               /* 
+                * Access to this volume is most preferred through
+                * this path and other paths with this value.
+                */
+               ret |= 0x02;
+               break;
+       case 0x02:
+               /*
+                * Access to this volume through this path is to be used
+                * as a secondary path. Typically this path would be used
+                * for fail-over situations.
+                */
+               /* Fallthrough */
+       default:
+               /* Reserved values */
+               break;
+       }
+       
+out:
+       return(ret);
+}
+
+int
+main (int argc, char **argv)
+{
+       int prio;
+       if (argc != 2) {
+               fprintf(stderr, "Wrong number of arguments.\n");
+               fprintf(stderr, "Usage: %s device\n", argv[0]);
+               prio = 0;
+       } else
+               prio = rdac_prio(argv[1]);
+
+       printf("%d\n", prio);
+       exit(0);
+}
diff --git a/path_priority/pp_tpc/Makefile b/path_priority/pp_tpc/Makefile
deleted file mode 100644 (file)
index c03e4c4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-EXEC           = mpath_prio_tpc
-BUILD          = glibc
-OBJS           = pp_tpc.o
-
-TOPDIR         = ../..
-include $(TOPDIR)/Makefile.inc
-
-all: $(BUILD)
-
-glibc: $(OBJS)
-       $(CC) -o $(EXEC) $(OBJS) $(LDFLAGS)
-
-klibc: $(OBJS)
-       $(CC) -static -o $(EXEC) $(OBJS)
-
-install: $(EXEC)
-       $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
-
-uninstall:
-       rm $(DESTDIR)$(bindir)/$(EXEC)
-clean: 
-       rm -f *.o $(EXEC)
diff --git a/path_priority/pp_tpc/pp_tpc.c b/path_priority/pp_tpc/pp_tpc.c
deleted file mode 100644 (file)
index a7ed7ad..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-
-#include "../../libmultipath/sg_include.h"
-
-#define INQUIRY_CMD     0x12
-#define INQUIRY_CMDLEN  6
-
-int sgi_tpc_prio(const char *dev)
-{
-       unsigned char sense_buffer[256];
-       unsigned char sb[128];
-       unsigned char inqCmdBlk[INQUIRY_CMDLEN] = {INQUIRY_CMD, 1, 0xC9, 0,
-                                               sizeof(sb), 0};
-       struct sg_io_hdr io_hdr;
-       int ret = 0;
-       int fd;
-
-       fd = open(dev, O_RDWR|O_NONBLOCK);
-
-       if (fd <= 0) {
-               fprintf(stderr, "opening of the device failed.\n");
-               goto out;
-       }
-
-       memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
-       io_hdr.interface_id = 'S';
-       io_hdr.cmd_len = sizeof (inqCmdBlk);
-       io_hdr.mx_sb_len = sizeof (sb);
-       io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
-       io_hdr.dxfer_len = sizeof (sense_buffer);
-       io_hdr.dxferp = sense_buffer;
-       io_hdr.cmdp = inqCmdBlk;
-       io_hdr.sbp = sb;
-       io_hdr.timeout = 60000;
-       io_hdr.pack_id = 0;
-       if (ioctl(fd, SG_IO, &io_hdr) < 0) {
-               fprintf(stderr, "sending inquiry command failed\n");
-               goto out;
-       }
-       if (io_hdr.info & SG_INFO_OK_MASK) {
-               fprintf(stderr, "inquiry command indicates error");
-               goto out;
-       }
-
-       close(fd);
-       
-       if (/* Verify the code page - right page & page identifier */
-           sense_buffer[1] != 0xc9 || 
-           sense_buffer[3] != 0x2c ||
-           sense_buffer[4] != 'v' ||
-           sense_buffer[5] != 'a' ||
-           sense_buffer[6] != 'c' ) {
-               fprintf(stderr, "Volume access control page in unknown format");
-               goto out;
-       }
-       
-       if ( /* Current Volume Path Bit */
-               ( sense_buffer[8] & 0x01) == 0x01 ) {
-               /* 
-                * This volume was owned by the controller receiving
-                * the inquiry command.
-                */
-               ret |= 0x01;
-       }
-
-       /* Volume Preferred Path Priority */
-       switch ( sense_buffer[9] & 0x0F ) {
-       case 0x01:
-               /* 
-                * Access to this volume is most preferred through
-                * this path and other paths with this value.
-                */
-               ret |= 0x02;
-               break;
-       case 0x02:
-               /*
-                * Access to this volume through this path is to be used
-                * as a secondary path. Typically this path would be used
-                * for fail-over situations.
-                */
-               /* Fallthrough */
-       default:
-               /* Reserved values */
-               break;
-       }
-       
-out:
-       return(ret);
-}
-
-int
-main (int argc, char **argv)
-{
-       int prio;
-       if (argc != 2) {
-               fprintf(stderr, "Wrong number of arguments.\n");
-               fprintf(stderr, "Usage: %s device\n", argv[0]);
-               prio = 0;
-       } else
-               prio = sgi_tpc_prio(argv[1]);
-
-       printf("%d\n", prio);
-       exit(0);
-}