Whamcloud - gitweb
Replace all of the "char[37]" uses with obd_uuid_t.
authoradilger <adilger>
Mon, 16 Sep 2002 23:10:40 +0000 (23:10 +0000)
committeradilger <adilger>
Mon, 16 Sep 2002 23:10:40 +0000 (23:10 +0000)
18 files changed:
lustre/include/linux/lustre_export.h
lustre/include/linux/lustre_idl.h
lustre/include/linux/lustre_lib.h
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_mds.h
lustre/include/linux/lustre_net.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/lib/l_net.c
lustre/lov/lov_obd.c
lustre/mds/handler.c
lustre/mds/mds_lov.c
lustre/obdclass/genops.c
lustre/obdclass/uuid.c
lustre/obdfilter/filter.c
lustre/ptlrpc/client.c
lustre/ptlrpc/connection.c
lustre/ptlrpc/service.c

index 6b00876..b1be23d 100644 (file)
@@ -30,7 +30,7 @@ struct obd_export {
         void                     *exp_data; /* device specific data */
         int                       exp_desclen;
         char                     *exp_desc;
-        uuid_t                    exp_uuid;
+        obd_uuid_t                exp_uuid;
 };
 
 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
index 557f183..2083315 100644 (file)
@@ -419,7 +419,7 @@ struct lov_desc {
         __u64 ld_default_stripe_size;      /* in bytes */
         __u64 ld_default_stripe_offset;    /* in bytes */
         __u32 ld_pattern;                  /* RAID 0,1 etc */
-        uuid_t ld_uuid;
+        obd_uuid_t ld_uuid;
 };
 
 /*
index d59a526..d3012a8 100644 (file)
@@ -53,7 +53,7 @@ struct recovd_data;
 int target_handle_connect(struct ptlrpc_request *req);
 int target_handle_disconnect(struct ptlrpc_request *req);
 int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       char *cluuid);
+                       obd_uuid_t cluuid);
 int client_obd_disconnect(struct lustre_handle *conn);
 int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf);
 int client_obd_cleanup(struct obd_device * obddev);
index e149a75..1daa659 100644 (file)
@@ -58,7 +58,7 @@ struct ll_inode_info {
 #define LL_SBI_NOLCK   0x1
 
 struct ll_sb_info {
-        unsigned char             ll_sb_uuid[37];
+        obd_uuid_t                ll_sb_uuid;
         struct lustre_handle      ll_mdc_conn;
         struct lustre_handle      ll_osc_conn;
         obd_id                    ll_rootino; /* number of root inode */
index d979c07..78a9004 100644 (file)
@@ -184,7 +184,7 @@ int mdc_rename(struct lustre_handle *conn,
                struct inode *src, struct inode *tgt, const char *old,
                int oldlen, const char *new, int newlen,
                struct ptlrpc_request **);
-int mdc_create_client(char *uuid, struct ptlrpc_client *cl);
+int mdc_create_client(obd_uuid_t uuid, struct ptlrpc_client *cl);
 
 extern int mds_client_add(struct mds_export_data *med, int cl_off);
 extern int mds_client_free(struct obd_export *exp);
index 6f24c60..a5626e5 100644 (file)
@@ -230,9 +230,9 @@ typedef void (*bulk_callback_t)(struct ptlrpc_bulk_desc *, void *);
 typedef int (*svc_handler_t)(struct ptlrpc_request *req);
 
 /* rpc/connection.c */
-void ptlrpc_readdress_connection(struct ptlrpc_connection *conn, char *uuid);
+void ptlrpc_readdress_connection(struct ptlrpc_connection *conn, obd_uuid_t uuid);
 struct ptlrpc_connection *ptlrpc_get_connection(struct lustre_peer *peer,
-                                                char *uuid);
+                                                obd_uuid_t uuid);
 int ptlrpc_put_connection(struct ptlrpc_connection *c);
 struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *);
 void ptlrpc_init_connection(void);
@@ -255,7 +255,7 @@ void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
                         struct ptlrpc_client *);
 void ptlrpc_cleanup_client(struct obd_import *imp);
 __u8 *ptlrpc_req_to_uuid(struct ptlrpc_request *req);
-struct ptlrpc_connection *ptlrpc_uuid_to_connection(char *uuid);
+struct ptlrpc_connection *ptlrpc_uuid_to_connection(obd_uuid_t uuid);
 
 int ptlrpc_queue_wait(struct ptlrpc_request *req);
 void ptlrpc_continue_req(struct ptlrpc_request *req);
@@ -274,8 +274,8 @@ int ptlrpc_check_status(struct ptlrpc_request *req, int err);
 
 /* rpc/service.c */
 struct ptlrpc_service *
-ptlrpc_init_svc(__u32 bufsize, int nbuffs, int req_portal, int rep_portal, 
-                char *uuid, svc_handler_t, char *name);
+ptlrpc_init_svc(__u32 bufsize, int nbuffs, int req_portal, int rep_portal,
+                obd_uuid_t uuid, svc_handler_t, char *name);
 void ptlrpc_stop_all_threads(struct ptlrpc_service *svc);
 int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc,
                         char *name);
index 80726ae..0877378 100644 (file)
@@ -41,13 +41,13 @@ struct lov_oinfo { /* per-child structure */
 
 struct lov_stripe_md {
         __u32 lsm_magic;
-        __u32 lsm_mds_easize;      /* packed size for MDS of ea */
+        __u32 lsm_mds_easize;      /* packed size for MDS of ea - KILL ME*/
         __u64 lsm_object_id;       /* lov object id */
         __u64 lsm_stripe_size;     /* size of the stripe */
         __u32 lsm_stripe_pattern;  /* per-lov object stripe pattern */
         int   lsm_stripe_offset;   /* offset of first stripe in lmd_objects */
         int   lsm_stripe_count;    /* how many objects are being striped on */
-        int   lsm_ost_count;       /* how many OSTs are in this LOV */
+        int   lsm_ost_count;       /* how many OSTs are in this LOV - KILL ME */
         struct lov_oinfo lsm_oinfo[0];
 };
 
@@ -95,7 +95,7 @@ struct client_obd {
         struct obd_import    cl_import;
         struct semaphore     cl_sem;
         int                  cl_conn_count;
-        __u8                 cl_target_uuid[37]; /* XXX -> lustre_name */
+        obd_uuid_t           cl_target_uuid; /* XXX -> lustre_name */
         int                  cl_max_mds_easize;
         int                  cl_max_ost_easize;
 };
@@ -175,7 +175,7 @@ struct ost_obd {
 
 
 struct lov_tgt_desc {
-        uuid_t uuid;
+        obd_uuid_t uuid;
         struct lustre_handle conn;
 };
 
@@ -205,7 +205,7 @@ struct obd_device {
 
         /* common and UUID name of this device */
         char *obd_name;
-        __u8 obd_uuid[37];
+        obd_uuid_t obd_uuid;
 
         int obd_minor;
         int obd_flags;
@@ -251,7 +251,7 @@ struct obd_ops {
         int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
         int (*o_cleanup)(struct obd_device *dev);
         int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
-                         char *cluuid);
+                         obd_uuid_t cluuid);
         int (*o_disconnect)(struct lustre_handle *conn);
 
 
index 1998b72..fa4fc4b 100644 (file)
@@ -28,7 +28,7 @@
 # define __KERNEL__
 # include <linux/list.h>
 # undef __KERNEL__
-#else 
+#else
 #include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
@@ -64,7 +64,7 @@ extern void proc_lustre_remove_obd_entry(const char* name,
  */
 
 #ifdef __KERNEL__
-static inline int obd_check_conn(struct lustre_handle *conn) 
+static inline int obd_check_conn(struct lustre_handle *conn)
 {
         struct obd_device *obd;
         if (!conn) {
@@ -83,7 +83,7 @@ static inline int obd_check_conn(struct lustre_handle *conn)
         }
 
         if (!obd->obd_flags & OBD_SET_UP) {
-                CERROR("obd %d not setup\n", obd->obd_minor); 
+                CERROR("obd %d not setup\n", obd->obd_minor);
                 RETURN(-ENODEV);
         }
 
@@ -102,7 +102,7 @@ static inline int obd_check_conn(struct lustre_handle *conn)
 
 
 #define OBT(dev)        (dev)->obd_type
-#define OBP(dev,op)     (dev)->obd_type->typ_ops->o_ ## op
+#define OBP(dev, op)    (dev)->obd_type->typ_ops->o_ ## op
 
 #define OBD_CHECK_SETUP(conn, export)                           \
 do {                                                            \
@@ -138,7 +138,7 @@ do {                                                            \
         }                                                       \
 } while (0)
 
-#define OBD_CHECK_OP(obd,op)                                   \
+#define OBD_CHECK_OP(obd, op)                                   \
 do {                                                            \
         if (!OBP((obd),op)) {                                   \
                 CERROR("obd_" #op ": dev %d no operation\n",    \
@@ -153,7 +153,7 @@ static inline int obd_get_info(struct lustre_handle *conn, obd_count keylen,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,get_info);
+        OBD_CHECK_OP(export->exp_obd, get_info);
 
         rc = OBP(export->exp_obd, get_info)(conn, keylen, key, vallen, val);
         RETURN(rc);
@@ -165,7 +165,7 @@ static inline int obd_set_info(struct lustre_handle *conn, obd_count keylen,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,set_info);
+        OBD_CHECK_OP(export->exp_obd, set_info);
 
         rc = OBP(export->exp_obd, set_info)(conn, keylen, key, vallen, val);
         RETURN(rc);
@@ -175,7 +175,7 @@ static inline int obd_setup(struct obd_device *obd, int datalen, void *data)
 {
         int rc;
 
-        OBD_CHECK_OP(obd,setup);
+        OBD_CHECK_OP(obd, setup);
 
         rc = OBP(obd, setup)(obd, datalen, data);
         RETURN(rc);
@@ -186,7 +186,7 @@ static inline int obd_cleanup(struct obd_device *obd)
         int rc;
 
         OBD_CHECK_DEVSETUP(obd);
-        OBD_CHECK_OP(obd,cleanup);
+        OBD_CHECK_OP(obd, cleanup);
 
         rc = OBP(obd, cleanup)(obd);
         RETURN(rc);
@@ -198,7 +198,7 @@ static inline int obd_create(struct lustre_handle *conn, struct obdo *obdo,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,create);
+        OBD_CHECK_OP(export->exp_obd, create);
 
 #define OBD_MD_FLNEEDED (OBD_MD_FLID | OBD_MD_FLMODE)
         //if (obdo->o_valid & OBD_MD_FLNEEDED != OBD_MD_FLNEEDED)
@@ -214,7 +214,7 @@ static inline int obd_destroy(struct lustre_handle *conn, struct obdo *obdo,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,destroy);
+        OBD_CHECK_OP(export->exp_obd, destroy);
 
         rc = OBP(export->exp_obd, destroy)(conn, obdo, ea);
         RETURN(rc);
@@ -226,32 +226,33 @@ static inline int obd_getattr(struct lustre_handle *conn, struct obdo *obdo,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,getattr);
+        OBD_CHECK_OP(export->exp_obd, getattr);
 
         rc = OBP(export->exp_obd, getattr)(conn, obdo, ea);
         RETURN(rc);
 }
 
 static inline int obd_close(struct lustre_handle *conn, struct obdo *obdo,
-                            struct lov_stripe_md *md)
+                            struct lov_stripe_md *ea)
 {
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,close);
+        OBD_CHECK_OP(export->exp_obd, close);
 
-        rc = OBP(export->exp_obd, close)(conn, obdo, md);
+        rc = OBP(export->exp_obd, close)(conn, obdo, ea);
         RETURN(rc);
 }
+
 static inline int obd_open(struct lustre_handle *conn, struct obdo *obdo,
-                           struct lov_stripe_md *md)
+                           struct lov_stripe_md *ea)
 {
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,open);
+        OBD_CHECK_OP(export->exp_obd, open);
 
-        rc = OBP(export->exp_obd, open) (conn, obdo, md);
+        rc = OBP(export->exp_obd, open)(conn, obdo, ea);
         RETURN(rc);
 }
 
@@ -267,12 +268,12 @@ static inline int obd_setattr(struct lustre_handle *conn, struct obdo *obdo,
         RETURN(rc);
 }
 
-static inline int obd_connect(struct lustre_handle *conn, struct obd_device *obd,
-                              char *cluuid)
+static inline int obd_connect(struct lustre_handle *conn,
+                              struct obd_device *obd, obd_uuid_t cluuid)
 {
         int rc;
         OBD_CHECK_DEVSETUP(obd);
-        OBD_CHECK_OP(obd,connect);
+        OBD_CHECK_OP(obd, connect);
 
         rc = OBP(obd, connect)(conn, obd, cluuid);
         RETURN(rc);
@@ -283,7 +284,7 @@ static inline int obd_disconnect(struct lustre_handle *conn)
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,disconnect);
+        OBD_CHECK_OP(export->exp_obd, disconnect);
 
         rc = OBP(export->exp_obd, disconnect)(conn);
         RETURN(rc);
@@ -294,7 +295,7 @@ static inline int obd_statfs(struct lustre_handle *conn,struct obd_statfs *osfs)
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,statfs);
+        OBD_CHECK_OP(export->exp_obd, statfs);
 
         rc = OBP(export->exp_obd, statfs)(conn, osfs);
         RETURN(rc);
@@ -341,7 +342,7 @@ static inline int obd_preprw(int cmd, struct lustre_handle *conn,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,preprw);
+        OBD_CHECK_OP(export->exp_obd, preprw);
 
         rc = OBP(export->exp_obd, preprw)(cmd, conn, objcount, obj, niocount,
                                           remote, local, desc_private);
@@ -356,7 +357,7 @@ static inline int obd_commitrw(int cmd, struct lustre_handle *conn,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,commitrw);
+        OBD_CHECK_OP(export->exp_obd, commitrw);
 
         rc = OBP(export->exp_obd, commitrw)(cmd, conn, objcount, obj, niocount,
                                             local, desc_private);
@@ -369,7 +370,7 @@ static inline int obd_iocontrol(int cmd, struct lustre_handle *conn,
         int rc;
         struct obd_export *export;
         OBD_CHECK_SETUP(conn, export);
-        OBD_CHECK_OP(export->exp_obd,iocontrol);
+        OBD_CHECK_OP(export->exp_obd, iocontrol);
 
         rc = OBP(export->exp_obd, iocontrol)(cmd, conn, len, karg, uarg);
         RETURN(rc);
@@ -675,7 +676,7 @@ static inline int obdo_cmp_md(struct obdo *dst, struct obdo *src,
                 res = (res || (dst->o_uid != src->o_uid));
         if ( compare & OBD_MD_FLGID )
                 res = (res || (dst->o_gid != src->o_gid));
-        if ( compare & OBD_MD_FLFLAGS ) 
+        if ( compare & OBD_MD_FLFLAGS )
                 res = (res || (dst->o_flags != src->o_flags));
         if ( compare & OBD_MD_FLNLINK )
                 res = (res || (dst->o_nlink != src->o_nlink));
@@ -693,12 +694,12 @@ static inline int obdo_cmp_md(struct obdo *dst, struct obdo *src,
 int class_register_type(struct obd_ops *ops, char *nm);
 int class_unregister_type(char *nm);
 int class_name2dev(char *name);
-int class_uuid2dev(char *name);
-struct obd_device *class_uuid2obd(char *name);
+int class_uuid2dev(char *uuid);
+struct obd_device *class_uuid2obd(char *uuid);
 struct obd_export *class_new_export(struct obd_device *obddev);
 void class_destroy_export(struct obd_export *exp);
 int class_connect(struct lustre_handle *conn, struct obd_device *obd,
-                  char *cluuid);
+                  obd_uuid_t cluuid);
 int class_disconnect(struct lustre_handle *conn);
 void class_disconnect_all(struct obd_device *obddev);
 
@@ -726,8 +727,7 @@ extern void obd_sysctl_init (void);
 extern void obd_sysctl_clean (void);
 
 /* uuid.c  */
-/* XXX - should use uuid_t here, but already defined as char[37] */
-typedef unsigned char class_uuid_t[16];
-int class_uuid_parse(char *in, class_uuid_t out);
-void class_uuid_unparse(class_uuid_t in, char *out);
+typedef __u8 class_uuid_t[16];
+//int class_uuid_parse(obd_uuid_t in, class_uuid_t out);
+void class_uuid_unparse(class_uuid_t in, obd_uuid_t out);
 #endif /* __LINUX_CLASS_OBD_H */
index 9a7ae96..6f9af2b 100644 (file)
@@ -52,7 +52,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         int rq_portal, rp_portal;
         char *name;
         struct client_obd *cli = &obddev->u.cli;
-        char server_uuid[37];
+        obd_uuid_t server_uuid;
         ENTRY;
 
         if (obddev->obd_type->typ_ops->o_brw) {
@@ -119,7 +119,7 @@ int client_obd_cleanup(struct obd_device * obddev)
 }
 
 int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       char *cluuid)
+                       obd_uuid_t cluuid)
 {
         struct client_obd *cli = &obd->u.cli;
         struct ptlrpc_request *request;
index 9c54c6a..8fd2714 100644 (file)
 
 /* obd methods */
 static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       char *cluuid)
+                       obd_uuid_t cluuid)
 {
         struct ptlrpc_request *req;
         struct lov_obd *lov = &obd->u.lov;
         struct client_obd *mdc = &lov->mdcobd->u.cli;
         struct lov_desc *desc = &lov->desc;
         struct lustre_handle mdc_conn;
-        uuid_t *uuidarray;
+        obd_uuid_t *uuidarray;
         int rc, rc2;
         int i;
 
index abfcfed..dcbe8b5 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/obd_class.h>
 
 extern int mds_get_lovtgts(struct obd_device *obd, int tgt_count,
-                           uuid_t *uuidarray);
+                           obd_uuid_t *uuidarray);
 extern int mds_get_lovdesc(struct obd_device *obd, struct lov_desc *desc);
 extern int mds_update_last_rcvd(struct mds_obd *mds, void *handle,
                                 struct ptlrpc_request *req);
@@ -261,7 +261,7 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
  * on the server, etc.
  */
 static int mds_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       char *cluuid)
+                       obd_uuid_t cluuid)
 {
         struct obd_export *exp;
         struct mds_client_data *mcd;
@@ -394,8 +394,8 @@ static int mds_getlovinfo(struct ptlrpc_request *req)
                 RETURN(0);
         }
 
-        tgt_count = NTOH__u32(desc->ld_tgt_count);
-        if (tgt_count * sizeof(uuid_t) > streq->repbuf) {
+        tgt_count = le32_to_cpu(desc->ld_tgt_count);
+        if (tgt_count * sizeof(obd_uuid_t) > streq->repbuf) {
                 CERROR("too many targets, enlarge client buffers\n");
                 req->rq_status = -ENOSPC;
                 RETURN(0);
@@ -692,11 +692,11 @@ static int mds_open(struct ptlrpc_request *req)
         /* check if this inode has seen a delayed object creation */
         if (req->rq_reqmsg->bufcount > 1) {
                 void *handle;
-                struct lov_mds_md *md;
+                struct lov_mds_md *lmm;
                 struct inode *inode = de->d_inode;
                 int rc;
 
-                md = lustre_msg_buf(req->rq_reqmsg, 1);
+                lmm = lustre_msg_buf(req->rq_reqmsg, 1);
 
                 handle = mds_fs_start(mds, de->d_inode, MDS_FSOP_SETATTR);
                 if (!handle) {
@@ -705,7 +705,7 @@ static int mds_open(struct ptlrpc_request *req)
                 }
 
                 /* XXX error handling */
-                rc = mds_fs_set_md(mds, inode, handle, md);
+                rc = mds_fs_set_md(mds, inode, handle, lmm);
                 if (!rc) {
                         struct obd_run_ctxt saved;
                         push_ctxt(&saved, &mds->mds_ctxt);
index 30d8482..e2e993d 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/lustre_lib.h>
 
 int mds_configure_lov(struct obd_device *obd, struct lov_desc *desc,
-                      uuid_t *uuidarray)
+                      obd_uuid_t *uuidarray)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct obd_run_ctxt saved;
@@ -108,7 +108,7 @@ int mds_get_lovdesc(struct obd_device *obd, struct lov_desc *desc)
         RETURN(0);
 }
 
-int mds_get_lovtgts(struct obd_device *obd, int tgt_count, uuid_t *uuidarray)
+int mds_get_lovtgts(struct obd_device *obd, int tgt_count,obd_uuid_t *uuidarray)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct obd_run_ctxt saved;
@@ -149,6 +149,7 @@ int mds_iocontrol(long cmd, struct lustre_handle *conn,
         struct obd_device *obd = class_conn2obd(conn);
         struct obd_ioctl_data *data = karg;
         struct lov_desc *desc;
+        obd_uuid_t *uuidarray;
         int count;
         int rc;
 
@@ -162,11 +163,12 @@ int mds_iocontrol(long cmd, struct lustre_handle *conn,
                 }
 
                 count = desc->ld_tgt_count;
-                if (sizeof(uuid_t) * count != data->ioc_inllen2) {
+                uuidarray = (obd_uuid_t *)data->ioc_inlbuf2;
+                if (sizeof(*uuidarray) * count != data->ioc_inllen2) {
                         CERROR("UUID array size wrong\n");
                         RETURN(-EINVAL);
                 }
-                rc = mds_configure_lov(obd, desc, (uuid_t *)data->ioc_inlbuf2);
+                rc = mds_configure_lov(obd, desc, uuidarray);
 
                 RETURN(rc);
         default:
index a6dc7b8..5ead79d 100644 (file)
@@ -409,8 +409,8 @@ void class_destroy_export(struct obd_export *exp)
 
 /* a connection defines an export context in which preallocation can
    be managed. */
-int class_connect (struct lustre_handle *conn, struct obd_device *obd,
-                   char *cluuid)
+int class_connect(struct lustre_handle *conn, struct obd_device *obd,
+                  obd_uuid_t cluuid)
 {
         struct obd_export * export;
         if (conn == NULL) {
index 115c5ce..7048baa 100644 (file)
@@ -86,7 +86,7 @@ static void uuid_pack(struct uuid *uu, class_uuid_t ptr)
        memcpy(out+10, uu->node, 6);
 }
 
-int class_uuid_parse(char *in, class_uuid_t uu)
+int class_uuid_parse(obd_uuid_t in, class_uuid_t uu)
 {
        struct uuid uuid;
        int i;
@@ -122,7 +122,7 @@ int class_uuid_parse(char *in, class_uuid_t uu)
 }
 #endif
 
-void class_uuid_unparse(class_uuid_t uu, char *out)
+void class_uuid_unparse(class_uuid_t uu, obd_uuid_t out)
 {
        struct uuid uuid;
 
index 0c738c3..b5e2c82 100644 (file)
@@ -338,7 +338,7 @@ static struct dentry *filter_parent(struct obd_device *obddev, obd_mode mode)
 
 /* obd methods */
 static int filter_connect(struct lustre_handle *conn, struct obd_device *obd,
-                          char *cluuid)
+                          obd_uuid_t cluuid)
 {
         int rc;
         ENTRY;
index e5e164e..70fe9c9 100644 (file)
@@ -41,7 +41,7 @@ __u8 *ptlrpc_req_to_uuid(struct ptlrpc_request *req)
         return req->rq_connection->c_remote_uuid;
 }
 
-struct ptlrpc_connection *ptlrpc_uuid_to_connection(char *uuid)
+struct ptlrpc_connection *ptlrpc_uuid_to_connection(obd_uuid_t uuid)
 {
         struct ptlrpc_connection *c;
         struct lustre_peer peer;
@@ -64,7 +64,7 @@ struct ptlrpc_connection *ptlrpc_uuid_to_connection(char *uuid)
         return c;
 }
 
-void ptlrpc_readdress_connection(struct ptlrpc_connection *conn, char *uuid)
+void ptlrpc_readdress_connection(struct ptlrpc_connection *conn,obd_uuid_t uuid)
 {
         struct lustre_peer peer;
         int err;
index d95ee40..ef4dd4f 100644 (file)
@@ -30,7 +30,7 @@ static struct list_head conn_list;
 static struct list_head conn_unused_list;
 
 struct ptlrpc_connection *ptlrpc_get_connection(struct lustre_peer *peer,
-                                                char *uuid)
+                                                obd_uuid_t uuid)
 {
         struct list_head *tmp, *pos;
         struct ptlrpc_connection *c;
@@ -43,7 +43,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct lustre_peer *peer,
         list_for_each(tmp, &conn_list) {
                 c = list_entry(tmp, struct ptlrpc_connection, c_link);
                 if (memcmp(peer, &c->c_peer, sizeof(*peer)) == 0 &&
-                    (!uuid || strcmp(c->c_remote_uuid, uuid) == 0)) {
+                    (!uuid || !memcmp(c->c_remote_uuid, uuid, sizeof(uuid)))) {
                         ptlrpc_connection_addref(c);
                         GOTO(out, c);
                 }
index 38bc4ab..f00eafd 100644 (file)
@@ -65,7 +65,7 @@ static int ptlrpc_check_event(struct ptlrpc_service *svc,
 
 struct ptlrpc_service *
 ptlrpc_init_svc(__u32 bufsize, int nbuffs, int req_portal, int rep_portal,
-                char *uuid, svc_handler_t handler, char *name)
+                obd_uuid_t uuid, svc_handler_t handler, char *name)
 {
         int err;
         int rc, i;