Whamcloud - gitweb
b=4019
authoralex <alex>
Wed, 28 Jul 2004 19:17:32 +0000 (19:17 +0000)
committeralex <alex>
Wed, 28 Jul 2004 19:17:32 +0000 (19:17 +0000)
r=adilger

 - obd_connect() gets one more arg: connect flags
 - client_connect_import() puts this flag in imp_connect_flags
 - ptlrpc_connect_import() sends this flag to peer
 - mds_lmv_connect() passes OBD_OPT_MDS_CONNECTION when connects to MDS
 - mds_connect() looks for OBD_OPT_MDS_CONNECTION and treats
   connection with this flag as MDS-to-MDS and doesn't try
   to connect to own LMV

 this way connection to LMV gets delayed and MDS reconnects to LMV
 after recovery abort

22 files changed:
lustre/cmobd/cache_manager_obd.c
lustre/cobd/cache_obd.c
lustre/include/linux/lustre_import.h
lustre/include/linux/lustre_net.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/ldlm/ldlm_lib.c
lustre/llite/llite_lib.c
lustre/lmv/lmv_obd.c
lustre/lov/lov_obd.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mds/mds_lmv.c
lustre/mds/mds_lov.c
lustre/obdclass/llog_test.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/obdfilter/filter.c
lustre/osc/osc_request.c
lustre/ptlbd/client.c
lustre/ptlbd/server.c
lustre/ptlrpc/import.c

index 692f33f..92d850f 100644 (file)
@@ -94,7 +94,7 @@ static int cmobd_setup(struct obd_device *obd, obd_count len, void *buf)
         }
 
         /* master lov connects to master ost here */
-        rc = obd_connect(&conn, cmobd->cm_master_obd, &obd->obd_uuid); 
+        rc = obd_connect(&conn, cmobd->cm_master_obd, &obd->obd_uuid, 0); 
         if (rc)
                 RETURN(rc);
         cmobd->cm_master_exp = class_conn2export(&conn);
index a326430..72d0ab7 100644 (file)
@@ -58,7 +58,7 @@ static int connect_to_obd(char *name, struct lustre_handle *conn)
                        obd->obd_name, name);
                 RETURN(-EINVAL);
         }
-        rc = obd_connect(conn, obd, &obd_uuid);
+        rc = obd_connect(conn, obd, &obd_uuid, 0);
         RETURN(rc);
 }
 
@@ -187,7 +187,7 @@ struct obd_export *cobd_get_exp(struct obd_device *obd)
 
 static int
 cobd_connect(struct lustre_handle *conn, struct obd_device *obd,
-             struct obd_uuid *cluuid)
+             struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         int rc;
         rc = class_connect(conn, obd, cluuid);
index 4cc6314..56aed70 100644 (file)
@@ -86,6 +86,7 @@ struct obd_import {
                                   imp_initial_recov:1, imp_force_verify:1,
                                   imp_pingable:1, imp_resend_replay:1;
         __u32                     imp_connect_op;
+        __u32                     imp_connect_flags;
 };
 
 typedef void (*obd_import_callback)(struct obd_import *imp, void *closure,
index f94bd90..4890358 100644 (file)
@@ -710,7 +710,7 @@ void *mdc_rename_pack(struct lustre_msg *msg, int offset,
 int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf);
 int client_obd_cleanup(struct obd_device * obddev, int flags);
 int client_connect_import(struct lustre_handle *conn, struct obd_device *obd,
-                          struct obd_uuid *cluuid);
+                          struct obd_uuid *cluuid, unsigned long);
 int client_disconnect_export(struct obd_export *exp, int failover);
 
 /* ptlrpc/pinger.c */
index e501004..a1fa34c 100644 (file)
@@ -443,6 +443,7 @@ struct lmv_obd {
         int                     max_easize;
         int                     max_cookiesize;
         int                     server_timeout;
+        int                     connect_flags;
 };
 
 struct niobuf_local {
@@ -612,6 +613,7 @@ struct obd_device {
 #define OBD_OPT_FORCE           0x0001
 #define OBD_OPT_FAILOVER        0x0002
 #define OBD_OPT_REAL_CLIENT     0x0004
+#define OBD_OPT_MDS_CONNECTION  0x0008
 
 #define OBD_LLOG_FL_SENDNOW     0x0001
 #define OBD_LLOG_FL_CREATE      0x0002
@@ -635,7 +637,7 @@ struct obd_ops {
                                 void *data);
         int (*o_postrecov)(struct obd_device *dev);
         int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
-                         struct obd_uuid *cluuid);
+                         struct obd_uuid *cluuid, unsigned long connect_flags);
         int (*o_disconnect)(struct obd_export *exp, int flags);
 
         int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
index c371aff..9816db8 100644 (file)
@@ -623,7 +623,8 @@ static inline int obd_setattr(struct obd_export *exp, struct obdo *obdo,
 }
 
 static inline int obd_connect(struct lustre_handle *conn,
-                              struct obd_device *obd, struct obd_uuid *cluuid)
+                              struct obd_device *obd, struct obd_uuid *cluuid,
+                              unsigned long connect_flags)
 {
         int rc;
         ENTRY;
@@ -632,7 +633,7 @@ static inline int obd_connect(struct lustre_handle *conn,
         OBD_CHECK_OP(obd, connect, -EOPNOTSUPP);
         OBD_COUNTER_INCREMENT(obd, connect);
 
-        rc = OBP(obd, connect)(conn, obd, cluuid);
+        rc = OBP(obd, connect)(conn, obd, cluuid, connect_flags);
         RETURN(rc);
 }
 
index d86e892..9a9721e 100644 (file)
@@ -219,7 +219,8 @@ int client_obd_cleanup(struct obd_device *obddev, int flags)
 
 int client_connect_import(struct lustre_handle *dlm_handle,
                           struct obd_device *obd,
-                          struct obd_uuid *cluuid)
+                          struct obd_uuid *cluuid,
+                          unsigned long connect_flags)
 {
         struct client_obd *cli = &obd->u.cli;
         struct obd_import *imp = cli->cl_import;
@@ -250,6 +251,7 @@ int client_connect_import(struct lustre_handle *dlm_handle,
                 GOTO(out_ldlm, rc);
 
         exp->exp_connection = ptlrpc_connection_addref(imp->imp_connection);
+        imp->imp_connect_flags = connect_flags;
         rc = ptlrpc_connect_import(imp, NULL);
         if (rc != 0) {
                 LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
@@ -363,6 +365,7 @@ int target_handle_reconnect(struct lustre_handle *conn, struct obd_export *exp,
 
 int target_handle_connect(struct ptlrpc_request *req)
 {
+        unsigned long connect_flags = 0, *cfp;
         struct obd_device *target;
         struct obd_export *export = NULL;
         struct obd_import *revimp;
@@ -429,6 +432,10 @@ int target_handle_connect(struct ptlrpc_request *req)
 
         memcpy(&conn, tmp, sizeof conn);
 
+        cfp = lustre_msg_buf(req->rq_reqmsg, 3, sizeof(unsigned long));
+        LASSERT(cfp != NULL);
+        connect_flags = *cfp;
+
         rc = lustre_pack_reply(req, 0, NULL, NULL);
         if (rc)
                 GOTO(out, rc);
@@ -479,8 +486,8 @@ int target_handle_connect(struct ptlrpc_request *req)
 
         /* Tell the client if we're in recovery. */
         /* If this is the first client, start the recovery timer */
-        CWARN("%s: connection from %s@%s %s\n", target->obd_name, cluuid.uuid,
-              ptlrpc_peernid2str(&req->rq_peer, peer_str),
+        CWARN("%s: connection from %s@%s/%lu %s\n", target->obd_name, cluuid.uuid,
+              ptlrpc_peernid2str(&req->rq_peer, peer_str), *cfp,
               target->obd_recovering ? "(recovering)" : "");
         if (target->obd_recovering) {
                 lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_RECOVERING);
@@ -501,7 +508,7 @@ int target_handle_connect(struct ptlrpc_request *req)
                         rc = -EBUSY;
                 } else {
  dont_check_exports:
-                        rc = obd_connect(&conn, target, &cluuid);
+                        rc = obd_connect(&conn, target, &cluuid, connect_flags);
                 }
         }
         /* Tell the client if we support replayable requests */
index 304c718..d8ae8e8 100644 (file)
@@ -99,17 +99,11 @@ int lustre_init_ea_size(struct ll_sb_info *sbi)
         valsize = sizeof(desc);
         rc = obd_get_info(sbi->ll_osc_exp, strlen("lovdesc") + 1, "lovdesc", 
                           &valsize, &desc);
-        if (rc == 0) {
-                obd_init_ea_size(sbi->ll_mdc_exp,
-                                 obd_size_diskmd(sbi->ll_osc_exp, NULL),
-                                 desc.ld_tgt_count*sizeof(struct llog_cookie));
-
-                /* declare ourself as real client. not connection
-                 * from another MDS 
-                 * FIXME: remove fake valsize, mdsize --bzzz */
-                rc = obd_set_info(sbi->ll_mdc_exp, strlen("client"),
-                                  "client", valsize, &desc);
-        }
+        if (rc)
+                RETURN(rc);
+        obd_init_ea_size(sbi->ll_mdc_exp, obd_size_diskmd(sbi->ll_osc_exp, NULL),
+                         desc.ld_tgt_count*sizeof(struct llog_cookie));
+
         RETURN(rc);
 }
 #if CONFIG_SNAPFS
@@ -208,7 +202,7 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc)
                         CERROR("could not register mount in /proc/lustre");
         }
 
-        err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid);
+        err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid, 0);
         if (err == -EBUSY) {
                 CERROR("An MDS (mdc %s) is performing recovery, of which this"
                        " client is not a part.  Please wait for recovery to "
@@ -241,7 +235,7 @@ int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc)
                 GOTO(out_mdc, err);
         }
 
-        err = obd_connect(&osc_conn, obd, &sbi->ll_sb_uuid);
+        err = obd_connect(&osc_conn, obd, &sbi->ll_sb_uuid, 0);
         if (err == -EBUSY) {
                 CERROR("An OST (osc %s) is performing recovery, of which this"
                        " client is not a part.  Please wait for recovery to "
@@ -584,7 +578,7 @@ static int lustre_process_log(struct lustre_mount_data *lmd, char *profile,
         if (err)
                 GOTO(out_cleanup, err);
 
-        err = obd_connect(&mdc_conn, obd, &mdc_uuid);
+        err = obd_connect(&mdc_conn, obd, &mdc_uuid, 0);
         if (err) {
                 CERROR("cannot connect to %s: rc = %d\n", lmd->lmd_mds, err);
                 GOTO(out_cleanup, err);
index dadea41..9d6aab1 100644 (file)
@@ -171,7 +171,7 @@ int lmv_detach(struct obd_device *dev)
  * say caller that everything is okay. Real connection will be performed
  * later. */
 static int lmv_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       struct obd_uuid *cluuid)
+                       struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         struct lmv_obd *lmv = &obd->u.lmv;
         struct obd_export *exp;
@@ -194,6 +194,7 @@ static int lmv_connect(struct lustre_handle *conn, struct obd_device *obd,
         }
 
         lmv->cluuid = *cluuid;
+        lmv->connect_flags = connect_flags;
         lmv->connected = 0;
         lmv->exp = exp;
 
@@ -222,7 +223,8 @@ void lmv_set_timeouts(struct obd_device *obd)
 }
 
 /* Performs a check if passed obd is connected. If no - connect it. */
-int lmv_check_connect(struct obd_device *obd) {
+int lmv_check_connect(struct obd_device *obd)
+{
         struct lmv_obd *lmv = &obd->u.lmv;
         struct obd_uuid *cluuid;
         struct lmv_tgt_desc *tgts;
@@ -271,7 +273,7 @@ int lmv_check_connect(struct obd_device *obd) {
                         GOTO(out_disc, rc = -EINVAL);
                 }
                 
-                rc = obd_connect(&conn, tgt_obd, &lmv_osc_uuid);
+                rc = obd_connect(&conn, tgt_obd, &lmv_osc_uuid, lmv->connect_flags);
                 if (rc) {
                         CERROR("Target %s connect error %d\n",
                                 tgts->uuid.uuid, rc);
@@ -1600,22 +1602,7 @@ int lmv_set_info(struct obd_export *exp, obd_count keylen,
         }
         lmv = &obd->u.lmv;
 
-        if (keylen >= strlen("client") && strcmp(key, "client") == 0) {
-                struct lmv_tgt_desc *tgts;
-                int i, rc;
-
-                rc = lmv_check_connect(obd);
-                if (rc)
-                        RETURN(rc);
-
-                for (i = 0, tgts = lmv->tgts; 
-                        i < lmv->desc.ld_tgt_count; i++, tgts++) {
-                        rc = obd_set_info(tgts->ltd_exp, keylen, key, vallen, val);
-                        if (rc)
-                                RETURN(rc);
-                }
-                RETURN(0);
-        } else if (keylen >= strlen("inter_mds") && strcmp(key, "inter_mds") == 0) {
+        if (keylen >= strlen("inter_mds") && strcmp(key, "inter_mds") == 0) {
                 lmv->server_timeout = 1;
                 lmv_set_timeouts(obd);
                 RETURN(0);
index 14935b7..6029ed1 100644 (file)
@@ -157,7 +157,7 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
                 RETURN(0);
         }
 
-        rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid);
+        rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid, 0);
         if (rc) {
                 CERROR("Target %s connect error %d\n", tgt_uuid->uuid, rc);
                 RETURN(rc);
@@ -205,7 +205,7 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
 }
 
 static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       struct obd_uuid *cluuid)
+                       struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         struct lov_obd *lov = &obd->u.lov;
         struct lov_tgt_desc *tgt;
index a33ea6c..4e88c5f 100644 (file)
@@ -718,19 +718,6 @@ int mdc_set_info(struct obd_export *exp, obd_count keylen,
                        exp->exp_obd->obd_name,
                        imp->imp_initial_recov);
                 RETURN(0);
-        } else if (keylen >= strlen("client") && strcmp(key, "client") == 0) {
-                struct ptlrpc_request *req;
-                char *bufs[1] = {key};
-                int rc;
-                req = ptlrpc_prep_req(class_exp2cliimp(exp), OST_SET_INFO, 1,
-                                      &keylen, bufs);
-                if (req == NULL)
-                        RETURN(-ENOMEM);
-
-                req->rq_replen = lustre_msg_size(0, NULL);
-                rc = ptlrpc_queue_wait(req);
-                ptlrpc_req_finished(req);
-                RETURN(rc);
         } else if (keylen >= strlen("mds_num") && strcmp(key, "mds_num") == 0) {
                 struct ptlrpc_request *req;
                 int rc, size[2] = {keylen, vallen};
index 2bb3af4..33b6f09 100644 (file)
@@ -340,7 +340,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,
-                       struct obd_uuid *cluuid)
+                       struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         struct obd_export *exp;
         struct mds_export_data *med; /*  */
@@ -378,8 +378,22 @@ static int mds_connect(struct lustre_handle *conn, struct obd_device *obd,
         med->med_mcd = mcd;
 
         rc = mds_client_add(obd, &obd->u.mds, med, -1);
-        if (rc == 0)
-                EXIT;
+        if (rc)
+                GOTO(out, rc);
+       
+        if (!(connect_flags & OBD_OPT_MDS_CONNECTION)) {
+                struct mds_obd *mds = &obd->u.mds;
+                if (!(exp->exp_flags & OBD_OPT_REAL_CLIENT)) {
+                        atomic_inc(&mds->mds_real_clients);
+                        CDEBUG(D_OTHER,"%s: peer from %s is real client (%d)\n",
+                               obd->obd_name, exp->exp_client_uuid.uuid,
+                               atomic_read(&mds->mds_real_clients));
+                        exp->exp_flags |= OBD_OPT_REAL_CLIENT;
+                }
+                if (mds->mds_lmv_name)
+                        rc = mds_lmv_connect(obd, mds->mds_lmv_name);
+        }
+        EXIT;
 out:
         if (rc) {
                 OBD_FREE(mcd, sizeof(*mcd));
@@ -1573,19 +1587,6 @@ static int mds_set_info(struct obd_export *exp, __u32 keylen,
                 rc = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), "mds_conn",
                           valsize, &group);
                 RETURN(rc);
-        } else if (KEY_IS("client")) {
-                if (!(exp->exp_flags & OBD_OPT_REAL_CLIENT)) {
-                        atomic_inc(&mds->mds_real_clients);
-                        CDEBUG(D_OTHER,"%s: peer from %s is real client (%d)\n",
-                               obd->obd_name, exp->exp_client_uuid.uuid,
-                               atomic_read(&mds->mds_real_clients));
-                        exp->exp_flags |= OBD_OPT_REAL_CLIENT;
-                }
-                if (mds->mds_lmv_name) {
-                        rc = mds_lmv_connect(obd, mds->mds_lmv_name);
-                        LASSERT(rc == 0);
-                }
-                RETURN(0);
         }
         CDEBUG(D_IOCTL, "invalid key\n");
         RETURN(-EINVAL);
index 7b7343c..225d55a 100644 (file)
@@ -65,7 +65,7 @@ int mds_lmv_connect(struct obd_device *obd, char * lmv_name)
                 RETURN(-ENOTCONN);
         }
 
-        rc = obd_connect(&conn, mds->mds_lmv_obd, &obd->obd_uuid);
+        rc = obd_connect(&conn, mds->mds_lmv_obd, &obd->obd_uuid, OBD_OPT_MDS_CONNECTION);
         if (rc) {
                 CERROR("MDS cannot connect to LMV %s (%d)\n",
                        lmv_name, rc);
@@ -104,7 +104,7 @@ int mds_lmv_connect(struct obd_device *obd, char * lmv_name)
                           "inter_mds", 0, NULL);
         if (rc)
                 GOTO(err_reg, rc);
-        
+
        RETURN(0);
 
 err_reg:
index 031ec32..5b80aa0 100644 (file)
@@ -219,7 +219,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name)
         CDEBUG(D_HA, "obd: %s osc: %s lov_name: %s\n",
                obd->obd_name, mds->mds_osc_obd->obd_name, lov_name);
 
-        rc = obd_connect(&conn, mds->mds_osc_obd, &obd->obd_uuid);
+        rc = obd_connect(&conn, mds->mds_osc_obd, &obd->obd_uuid, 0);
         if (rc) {
                 CERROR("MDS cannot connect to LOV %s (%d)\n",
                        lov_name, rc);
index ff6e5ba..3ceaca8 100644 (file)
@@ -465,7 +465,7 @@ static int llog_test_6(struct obd_device *obd, char *name)
                 RETURN(-ENOENT);
         }
 
-        rc = obd_connect(&exph, mdc_obd, &uuid);
+        rc = obd_connect(&exph, mdc_obd, &uuid, 0);
         if (rc) {
                 CERROR("6: failed to connect to MDC: %s\n", mdc_obd->obd_name);
                 RETURN(rc);
index 2f641ff..896270f 100644 (file)
@@ -59,7 +59,7 @@ enum {
 };
 
 static int echo_connect(struct lustre_handle *conn, struct obd_device *obd,
-                        struct obd_uuid *cluuid)
+                        struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         return class_connect(conn, obd, cluuid);
 }
index ecca251..e4ffd4e 100644 (file)
@@ -1341,7 +1341,7 @@ echo_client_setup(struct obd_device *obddev, obd_count len, void *buf)
         INIT_LIST_HEAD (&ec->ec_objects);
         ec->ec_unique = 0;
 
-        rc = obd_connect(&conn, tgt, &echo_uuid);
+        rc = obd_connect(&conn, tgt, &echo_uuid, 0);
         if (rc) {
                 CERROR("fail to connect to device %s\n", lcfg->lcfg_inlbuf1);
                 return (rc);
@@ -1383,7 +1383,8 @@ static int echo_client_cleanup(struct obd_device *obddev, int flags)
 }
 
 static int echo_client_connect(struct lustre_handle *conn,
-                               struct obd_device *src, struct obd_uuid *cluuid)
+                               struct obd_device *src, struct obd_uuid *cluuid,
+                               unsigned long connect_flags)
 {
         struct obd_export *exp;
         int                rc;
index 43c429c..16edf27 100644 (file)
@@ -1522,7 +1522,7 @@ static int filter_cleanup(struct obd_device *obd, int flags)
 
 /* nearly identical to mds_connect */
 static int filter_connect(struct lustre_handle *conn, struct obd_device *obd,
-                          struct obd_uuid *cluuid)
+                          struct obd_uuid *cluuid, unsigned long connect_flags)
 {
         struct obd_export *exp;
         struct filter_export_data *fed;
index 49a4cbd..50fa9b3 100644 (file)
@@ -2870,11 +2870,12 @@ static int osc_llog_finish(struct obd_device *obd,
 
 
 static int osc_connect(struct lustre_handle *exph,
-                       struct obd_device *obd, struct obd_uuid *cluuid)
+                       struct obd_device *obd, struct obd_uuid *cluuid,
+                       unsigned long connect_flags)
 {
         int rc;
 
-        rc = client_connect_import(exph, obd, cluuid);
+        rc = client_connect_import(exph, obd, cluuid, 0);
 
         return rc;
 }
index 1903101..4b1c5ad 100644 (file)
@@ -113,7 +113,7 @@ static int ptlbd_cl_cleanup(struct obd_device *obd, int flags)
 
 /* modelled after ptlrpc_import_connect() */
 int ptlbd_cl_connect(struct lustre_handle *conn, struct obd_device *obd,
-                     struct obd_uuid *target_uuid)
+                     struct obd_uuid *target_uuid, unsigned long connect_flags)
 {
         struct ptlbd_obd *ptlbd = &obd->u.ptlbd;
         struct obd_import *imp = ptlbd->bd_import;
@@ -232,7 +232,7 @@ int ptlbd_do_connect(struct ptlbd_obd *ptlbd)
         ENTRY;
 
         memset(&conn, 0, sizeof(conn));
-        rc = obd_connect(&conn, obd, &ptlbd->bd_server_uuid);
+        rc = obd_connect(&conn, obd, &ptlbd->bd_server_uuid, 0);
         if (rc < 0)
                 RETURN(rc);
         ptlbd->bd_exp = class_conn2export(&conn);
index 6a1f90b..e54e5b3 100644 (file)
@@ -100,13 +100,22 @@ static int ptlbd_sv_cleanup(struct obd_device *obd, int flags)
         RETURN(0);
 }
 
+static int ptlbd_connect(struct lustre_handle *conn, struct obd_device *obd,
+                struct obd_uuid *cluuid, unsigned long connect_flags)
+{
+        int rc;
+
+        rc = class_connect(conn, obd, cluuid);
+        RETURN(rc);
+}
+
 static struct obd_ops ptlbd_sv_obd_ops = {
         .o_owner        = THIS_MODULE,
         .o_attach       = ptlbd_sv_attach,
         .o_detach       = ptlbd_sv_detach,
         .o_setup        = ptlbd_sv_setup,
         .o_cleanup      = ptlbd_sv_cleanup,
-        .o_connect      = class_connect,
+        .o_connect      = ptlbd_connect,
         .o_disconnect   = class_disconnect,
 };
 
index 5513345..b54c71f 100644 (file)
@@ -235,10 +235,12 @@ int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid)
         struct ptlrpc_request *request;
         int size[] = {sizeof(imp->imp_target_uuid),
                                  sizeof(obd->obd_uuid),
-                                 sizeof(imp->imp_dlm_handle)};
+                                 sizeof(imp->imp_dlm_handle),
+                                 sizeof(unsigned long)};
         char *tmp[] = {imp->imp_target_uuid.uuid,
                        obd->obd_uuid.uuid,
-                       (char *)&imp->imp_dlm_handle};
+                       (char *)&imp->imp_dlm_handle,
+                       (char *)&imp->imp_connect_flags}; /* XXX: make this portable! */
         struct ptlrpc_connect_async_args *aa;
         unsigned long flags;
 
@@ -306,7 +308,7 @@ int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid)
 
         }
 
-        request = ptlrpc_prep_req(imp, imp->imp_connect_op, 3, size, tmp);
+        request = ptlrpc_prep_req(imp, imp->imp_connect_op, 4, size, tmp);
         if (!request)
                 GOTO(out, rc = -ENOMEM);