Whamcloud - gitweb
r=adilger
[fs/lustre-release.git] / lustre / obdclass / uuid.c
index 9f103df..6f1c9c8 100644 (file)
@@ -23,7 +23,8 @@
 
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
-#include <linux/obd_ost.h>
+#include <linux/obd_ost.h> /* for LUSTRE_OST_NAME */
+#include <linux/lustre_mds.h> /* for LUSTRE_MDC_NAME */
 
 struct uuid {
        __u32   time_low;
@@ -133,7 +134,7 @@ void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out)
        struct uuid uuid;
 
        uuid_unpack(uu, &uuid);
-       sprintf(out->uuid,
+       sprintf((char *)out->uuid,
                "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
                uuid.clock_seq >> 8, uuid.clock_seq & 0xFF,
@@ -149,13 +150,13 @@ struct obd_device *client_tgtuuid2obd(struct obd_uuid *tgtuuid)
                 struct obd_device *obd = &obd_dev[i];
                 if (obd->obd_type == NULL)
                         continue;
-                if ((strncmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME,
-                             sizeof LUSTRE_OSC_NAME) == 0) ||
-                    (strncmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME,
-                             sizeof LUSTRE_MDC_NAME) == 0)) {
+                if ((strncmp(obd->obd_type->typ_name, OBD_OSC_DEVICENAME,
+                             sizeof(OBD_OSC_DEVICENAME)) == 0) ||
+                    (strncmp(obd->obd_type->typ_name, OBD_MDC_DEVICENAME,
+                             sizeof(OBD_MDC_DEVICENAME)) == 0)) {
                         struct client_obd *cli = &obd->u.cli;
                         struct obd_import *imp = cli->cl_import;
-                        if (strncmp(tgtuuid->uuid, imp->imp_target_uuid.uuid,
+                        if (strncmp((char *)tgtuuid->uuid, (char *)imp->imp_target_uuid.uuid,
                                     sizeof(imp->imp_target_uuid)) == 0)
                                 return obd;
                 }