Whamcloud - gitweb
- a pretty big patch that replaces our handling of uuid's through
authorbraam <braam>
Tue, 14 Jan 2003 00:16:05 +0000 (00:16 +0000)
committerbraam <braam>
Tue, 14 Jan 2003 00:16:05 +0000 (00:16 +0000)
  character strings, arrays and a uuid_t uniformly with one type
  struct obd_uuid
- goal: fix the lov startup on ia64.

lustre/cobd/cache_obd.c
lustre/cobd/lproc_cache.c
lustre/ptlbd/client.c
lustre/ptlbd/server.c

index e63d15f..a6e6b21 100644 (file)
@@ -36,26 +36,30 @@ cobd_setup (struct obd_device *dev, obd_count len, void *buf)
         struct cache_obd  *cobd = &dev->u.cobd;
         struct obd_device *target;
         struct obd_device *cache;
+        struct obd_uuid target_uuid;
+        struct obd_uuid cache_uuid;
         int                rc;
 
         if (data->ioc_inlbuf1 == NULL ||
             data->ioc_inlbuf2 == NULL)
                 return (-EINVAL);
 
-        target = class_uuid2obd (data->ioc_inlbuf1);
-        cache  = class_uuid2obd (data->ioc_inlbuf2);
+        obd_str2uuid(&target_uuid, data->ioc_inlbuf1);
+        target = class_uuid2obd (&target_uuid);
+
+        obd_str2uuid(&cache_uuid, data->ioc_inlbuf2);
+        cache  = class_uuid2obd (&cache_uuid);
         if (target == NULL ||
             cache == NULL)
                 return (-EINVAL);
 
         /* don't bother checking attached/setup;
          * obd_connect() should, and it can change underneath us */
-
-        rc = obd_connect (&cobd->cobd_target, target, NULL, NULL, NULL);
+        rc = obd_connect (&cobd->cobd_target, target, &target_uuid, NULL, NULL);
         if (rc != 0)
                 return (rc);
 
-        rc = obd_connect (&cobd->cobd_cache, cache, NULL, NULL, NULL);
+        rc = obd_connect (&cobd->cobd_cache, cache, &cache_uuid, NULL, NULL);
         if (rc != 0)
                 goto fail_0;
 
@@ -88,7 +92,7 @@ cobd_cleanup (struct obd_device *dev)
 
 static int
 cobd_connect (struct lustre_handle *conn, struct obd_device *obd,
-              obd_uuid_t cluuid, struct recovd_obd *recovd,
+              struct obd_uuid *cluuid, struct recovd_obd *recovd,
               ptlrpc_recovery_cb_t recover)
 {
         int rc = class_connect (conn, obd, cluuid);
index 63e0d8b..790806d 100644 (file)
@@ -41,7 +41,7 @@ static int rd_target (char *page, char **start, off_t off, int count,
        else {
                exp = class_conn2export (conn);
                LASSERT(exp != NULL);
-               rc = snprintf(page, count, "%s\n", exp->exp_obd->obd_uuid);
+               rc = snprintf(page, count, "%s\n", exp->exp_obd->obd_uuid.uuid);
        }
        return (rc);
 }
@@ -59,7 +59,7 @@ static int rd_cache(char *page, char **start, off_t off, int count,
        else {
                exp = class_conn2export (conn);
                LASSERT (exp != NULL);
-               rc = snprintf(page, count, "%s\n", exp->exp_obd->obd_uuid);
+               rc = snprintf(page, count, "%s\n", exp->exp_obd->obd_uuid.uuid);
        }
        return (rc);
 }
index 18af8b1..3611a10 100644 (file)
@@ -36,7 +36,7 @@ static int ptlbd_cl_setup(struct obd_device *obddev, obd_count len, void *buf)
         struct ptlbd_obd *ptlbd = &obddev->u.ptlbd;
         struct obd_import *imp = &ptlbd->bd_import;
         struct obd_ioctl_data* data = buf;
-        obd_uuid_t server_uuid;
+        struct obd_uuid server_uuid;
         ENTRY;
 
         if ( ptlbd->bd_import.imp_connection != NULL )
@@ -52,10 +52,9 @@ static int ptlbd_cl_setup(struct obd_device *obddev, obd_count len, void *buf)
                 RETURN(-EINVAL);
         }
 
-        memcpy(server_uuid, data->ioc_inlbuf1, MIN(data->ioc_inllen1,
-                                                   sizeof(server_uuid)));
+        obd_str2uuid(&server_uuid, data->ioc_inlbuf1);
 
-        imp->imp_connection = ptlrpc_uuid_to_connection(server_uuid);
+        imp->imp_connection = ptlrpc_uuid_to_connection(&server_uuid);
         if (!imp->imp_connection)
                 RETURN(-ENOENT);
 
@@ -95,7 +94,7 @@ static int ptlbd_cl_cleanup(struct obd_device *obddev)
 
 #if 0
 static int ptlbd_cl_connect(struct lustre_handle *conn, struct obd_device *obd,
-                        obd_uuid_t cluuid, struct recovd_obd *recovd,
+                        struct obd_uuid cluuid, struct recovd_obd *recovd,
                         ptlrpc_recovery_cb_t recover)
 {
         struct ptlbd_obd *ptlbd = &obd->u.ptlbd;
index 4705bda..5141411 100644 (file)
@@ -56,7 +56,7 @@ static int ptlbd_sv_setup(struct obd_device *obddev, obd_count len, void *buf)
 {
 #if 0
         struct obd_ioctl_data* data = buf;
-        obd_uuid_t server_uuid;
+        struct obd_uuid server_uuid;
 #endif
         struct ptlbd_obd *ptlbd = &obddev->u.ptlbd;
         int rc;
@@ -122,7 +122,7 @@ static int ptlbd_sv_cleanup(struct obd_device *obddev)
 
 #if 0
 static int ptlbd_sv_connect(struct lustre_handle *conn, struct obd_device *src,
-                        obd_uuid_t cluuid, struct recovd_obd *recovd,
+                        struct obd_uuid cluuid, struct recovd_obd *recovd,
                         ptlrpc_recovery_cb_t recover)
 {
         return class_connect(conn, src, cluuid);