X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fuuid.c;h=6f1c9c8a181f05b97f6914c016fcbce332614da6;hb=fdb061c9ce3fd16e805ff07b1e80c8de46110004;hp=9f103df08fa2252ef020cd26e6532ff41abe8716;hpb=96ec6856f91f7f9031cfce4273c714d72cfe59ae;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/uuid.c b/lustre/obdclass/uuid.c index 9f103df..6f1c9c8 100644 --- a/lustre/obdclass/uuid.c +++ b/lustre/obdclass/uuid.c @@ -23,7 +23,8 @@ #include #include -#include +#include /* for LUSTRE_OST_NAME */ +#include /* 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; }