From 32e8ac52587c477b21d6a4069562d816841b11f9 Mon Sep 17 00:00:00 2001 From: adilger Date: Mon, 2 Sep 2002 21:36:04 +0000 Subject: [PATCH] Minor cleanups - use uuids in uuid2dev and uuid2obd, instead of names. --- lustre/obdclass/genops.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index e82b772..be6ff06 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -135,14 +135,14 @@ int class_name2dev(char *name) return res; } -int class_uuid2dev(char *name) +int class_uuid2dev(char *uuid) { int res = -1; int i; for (i=0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = &obd_dev[i]; - if (obd->obd_name && strncmp(name, obd->obd_uuid, 37) == 0) { + if (strncmp(uuid, obd->obd_uuid, sizeof(obd->obd_uuid)) == 0) { res = i; return res; } @@ -152,15 +152,14 @@ int class_uuid2dev(char *name) } -struct obd_device *class_uuid2obd(char *name) +struct obd_device *class_uuid2obd(char *uuid) { int i; for (i=0; i < MAX_OBD_DEVICES; i++) { struct obd_device *obd = &obd_dev[i]; - if (obd->obd_name && strncmp(name, obd->obd_uuid, 37) == 0) { + if (strncmp(uuid, obd->obd_uuid, sizeof(obd->obd_uuid)) == 0) return obd; - } } return NULL; -- 1.8.3.1