From 214580c88eaf7687fa693d9f60a0e32fe669725c Mon Sep 17 00:00:00 2001 From: braam Date: Tue, 14 Jan 2003 00:16:05 +0000 Subject: [PATCH] - a pretty big patch that replaces our handling of uuid's through 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 | 16 ++++++++++------ lustre/cobd/lproc_cache.c | 4 ++-- lustre/ptlbd/client.c | 9 ++++----- lustre/ptlbd/server.c | 4 ++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lustre/cobd/cache_obd.c b/lustre/cobd/cache_obd.c index e63d15f..a6e6b21 100644 --- a/lustre/cobd/cache_obd.c +++ b/lustre/cobd/cache_obd.c @@ -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); diff --git a/lustre/cobd/lproc_cache.c b/lustre/cobd/lproc_cache.c index 63e0d8b..790806d 100644 --- a/lustre/cobd/lproc_cache.c +++ b/lustre/cobd/lproc_cache.c @@ -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); } diff --git a/lustre/ptlbd/client.c b/lustre/ptlbd/client.c index 18af8b1..3611a10 100644 --- a/lustre/ptlbd/client.c +++ b/lustre/ptlbd/client.c @@ -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; diff --git a/lustre/ptlbd/server.c b/lustre/ptlbd/server.c index 4705bda..5141411 100644 --- a/lustre/ptlbd/server.c +++ b/lustre/ptlbd/server.c @@ -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); -- 1.8.3.1