Whamcloud - gitweb
- Move recovery setup into the (network-using) connect methods, to fix
authorshaver <shaver>
Tue, 15 Oct 2002 23:25:14 +0000 (23:25 +0000)
committershaver <shaver>
Tue, 15 Oct 2002 23:25:14 +0000 (23:25 +0000)
  LOVs.
- Updated lov.xml file.

18 files changed:
lustre/include/linux/lustre_lib.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/ldlm/ldlm_lockd.c
lustre/lib/client.c
lustre/lib/target.c
lustre/llite/super.c
lustre/lov/lov_obd.c
lustre/mds/handler.c
lustre/obdclass/class_obd.c
lustre/obdclass/genops.c
lustre/obdecho/echo.c
lustre/obdfilter/filter.c
lustre/ost/ost_handler.c
lustre/ptlrpc/connection.c
lustre/ptlrpc/recovd.c
lustre/ptlrpc/rpc.c
lustre/tests/lov.xml

index 6defd75..0e398bd 100644 (file)
 struct ptlrpc_request;
 struct obd_device;
 struct recovd_data;
+struct recovd_obd;
+#include <linux/lustre_ha.h>
 
 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,
-                       obd_uuid_t cluuid);
+                       obd_uuid_t cluuid, struct recovd_obd *recovd,
+                       ptlrpc_recovery_cb_t recover);
 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 549a54d..c253ca6 100644 (file)
@@ -260,7 +260,8 @@ 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,
-                         obd_uuid_t cluuid);
+                         obd_uuid_t cluuid, struct recovd_obd *recovd,
+                         ptlrpc_recovery_cb_t recover);
         int (*o_disconnect)(struct lustre_handle *conn);
 
 
index d9f2610..d2a963b 100644 (file)
@@ -273,14 +273,16 @@ static inline int obd_setattr(struct lustre_handle *conn, struct obdo *obdo,
 }
 
 static inline int obd_connect(struct lustre_handle *conn,
-                              struct obd_device *obd, obd_uuid_t cluuid)
+                              struct obd_device *obd, obd_uuid_t cluuid,
+                              struct recovd_obd *recovd,
+                              ptlrpc_recovery_cb_t recover)
 {
         int rc;
 
         OBD_CHECK_DEVSETUP(obd);
         OBD_CHECK_OP(obd, connect);
 
-        rc = OBP(obd, connect)(conn, obd, cluuid);
+        rc = OBP(obd, connect)(conn, obd, cluuid, recovd, recover);
         RETURN(rc);
 }
 
index 69cb485..5d03065 100644 (file)
@@ -635,11 +635,18 @@ static int ldlm_cleanup(struct obd_device *obddev)
         RETURN(0);
 }
 
+static int ldlm_connect(struct lustre_handle *conn, struct obd_device *src,
+                        obd_uuid_t cluuid, struct recovd_obd *recovd,
+                        ptlrpc_recovery_cb_t recover)
+{
+        return class_connect(conn, src, cluuid);
+}
+
 struct obd_ops ldlm_obd_ops = {
         o_iocontrol:   ldlm_iocontrol,
         o_setup:       ldlm_setup,
         o_cleanup:     ldlm_cleanup,
-        o_connect:     class_connect,
+        o_connect:     ldlm_connect,
         o_disconnect:  class_disconnect
 };
 
index 29f4a63..59116eb 100644 (file)
@@ -113,7 +113,8 @@ int client_obd_cleanup(struct obd_device * obddev)
 }
 
 int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       obd_uuid_t cluuid)
+                       obd_uuid_t cluuid, struct recovd_obd *recovd,
+                       ptlrpc_recovery_cb_t recover)
 {
         struct client_obd *cli = &obd->u.cli;
         struct ptlrpc_request *request;
@@ -149,6 +150,7 @@ int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
         request->rq_reqmsg->addr = conn->addr;
         request->rq_reqmsg->cookie = conn->cookie;
         c = class_conn2export(conn)->exp_connection = request->rq_connection;
+        recovd_conn_manage(c, recovd, recover);
 
         rc = ptlrpc_queue_wait(request);
         rc = ptlrpc_check_status(request, rc);
index 6750dbd..94665e0 100644 (file)
@@ -67,7 +67,8 @@ int target_handle_connect(struct ptlrpc_request *req)
         conn.addr = req->rq_reqmsg->addr;
         conn.cookie = req->rq_reqmsg->cookie;
 
-        rc = obd_connect(&conn, target, cluuid);
+        rc = obd_connect(&conn, target, cluuid, ptlrpc_recovd,
+                         target_revoke_connection);
         if (rc)
                 GOTO(out, rc);
 
@@ -90,8 +91,6 @@ int target_handle_connect(struct ptlrpc_request *req)
         list_add(&export->exp_conn_chain, &export->exp_connection->c_exports);
         spin_unlock(&export->exp_connection->c_lock);
 
-        recovd_conn_manage(export->exp_connection, ptlrpc_recovd,
-                           target_revoke_connection);
         dlmimp = &export->exp_ldlm_data.led_import;
         dlmimp->imp_connection = req->rq_connection;
         dlmimp->imp_client = &export->exp_obd->obd_ldlm_client;
index 587895c..605696f 100644 (file)
@@ -143,7 +143,8 @@ static struct super_block * ll_read_super(struct super_block *sb,
                 GOTO(out_free, sb = NULL);
         }
 
-        err = obd_connect(&sbi->ll_mdc_conn, obd, sbi->ll_sb_uuid);
+        err = obd_connect(&sbi->ll_mdc_conn, obd, sbi->ll_sb_uuid,
+                          ptlrpc_recovd, ll_recover);
         if (err) {
                 CERROR("cannot connect to %s: rc = %d\n", mdc, err);
                 GOTO(out_free, sb = NULL);
@@ -153,8 +154,6 @@ static struct super_block * ll_read_super(struct super_block *sb,
         mdc_conn = sbi2mdc(sbi)->cl_import.imp_connection;
         mdc_conn->c_level = LUSTRE_CONN_FULL;
         list_add(&mdc_conn->c_sb_chain, &sbi->ll_conn_chain);
-        recovd_conn_manage(class_conn2export(&sbi->ll_mdc_conn)->exp_connection,
-                           ptlrpc_recovd, ll_recover);
 
         obd = class_uuid2obd(osc);
         if (!obd) {
@@ -162,13 +161,12 @@ static struct super_block * ll_read_super(struct super_block *sb,
                 GOTO(out_mdc, sb = NULL);
         }
 
-        err = obd_connect(&sbi->ll_osc_conn, obd, sbi->ll_sb_uuid);
+        err = obd_connect(&sbi->ll_osc_conn, obd, sbi->ll_sb_uuid,
+                          ptlrpc_recovd, ll_recover);
         if (err) {
                 CERROR("cannot connect to %s: rc = %d\n", osc, err);
                 GOTO(out_mdc, sb = NULL);
         }
-        recovd_conn_manage(class_conn2export(&sbi->ll_osc_conn)->exp_connection,
-                           ptlrpc_recovd, ll_recover);
 
         /* XXX: need to store the last_* values somewhere */
         err = mdc_getstatus(&sbi->ll_mdc_conn, &rootfid, &last_committed,
index db1a2e2..946afc0 100644 (file)
@@ -28,7 +28,8 @@
 
 /* obd methods */
 static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       obd_uuid_t cluuid)
+                       obd_uuid_t cluuid, struct recovd_obd *recovd,
+                       ptlrpc_recovery_cb_t recover)
 {
         struct ptlrpc_request *req = NULL;
         struct lov_obd *lov = &obd->u.lov;
@@ -47,7 +48,7 @@ static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
         }
 
         /* retrieve LOV metadata from MDS */
-        rc = obd_connect(&mdc_conn, lov->mdcobd, NULL);
+        rc = obd_connect(&mdc_conn, lov->mdcobd, NULL, recovd, recover);
         if (rc) {
                 CERROR("cannot connect to mdc: rc = %d\n", rc);
                 GOTO(out_conn, rc);
@@ -129,7 +130,8 @@ static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
                         CERROR("Target %s not set up\n", uuidarray[i]);
                         GOTO(out_disc, rc = -EINVAL);
                 }
-                rc = obd_connect(&lov->tgts[i].conn, tgt, NULL);
+                rc = obd_connect(&lov->tgts[i].conn, tgt, NULL, recovd,
+                                 recover);
                 if (rc) {
                         CERROR("Target %s connect error %d\n",
                                uuidarray[i], rc);
index 6f149ab..1f60205 100644 (file)
@@ -264,7 +264,8 @@ 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,
-                       obd_uuid_t cluuid)
+                       obd_uuid_t cluuid, struct recovd_obd *recovd,
+                       ptlrpc_recovery_cb_t recover)
 {
         struct obd_export *exp;
         struct mds_export_data *med;
index 29d6f02..17f4355 100644 (file)
@@ -828,7 +828,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
                 char * cluuid = "OBD_CLASS_UUID";
                 obd_data2conn(&conn, data);
 
-                err = obd_connect(&conn, obd, cluuid);
+                err = obd_connect(&conn, obd, cluuid, NULL, NULL);
 
                 CDEBUG(D_IOCTL, "assigned export "LPX64"\n", conn.addr);
                 obd_conn2data(data, &conn);
index 6e923ee..26d66a6 100644 (file)
@@ -421,7 +421,6 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd,
         if (!export)
                 return -ENOMEM;
 
-
         conn->addr = (__u64) (unsigned long)export;
         conn->cookie = export->exp_cookie;
 
index 6d434a2..b12fe4b 100644 (file)
@@ -12,8 +12,8 @@
  * and Andreas Dilger <adilger@clusterfs.com>
  */
 
-static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.38 2002/09/24 19:18:16 adilger Exp $";
-#define OBDECHO_VERSION "$Revision: 1.38 $"
+static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.39 2002/10/15 23:25:10 shaver Exp $";
+#define OBDECHO_VERSION "$Revision: 1.39 $"
 
 #define EXPORT_SYMTAB
 
@@ -91,7 +91,8 @@ void echo_proc_fini(void)
 }
 
 static int echo_connect(struct lustre_handle *conn, struct obd_device *obd,
-                        obd_uuid_t cluuid)
+                        obd_uuid_t cluuid, struct recovd_obd *recovd,
+                        ptlrpc_recovery_cb_t recover)
 {
         int rc;
 
index b65b305..323b884 100644 (file)
@@ -337,7 +337,8 @@ 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,
-                          obd_uuid_t cluuid)
+                          obd_uuid_t cluuid, struct recovd_obd *recovd,
+                          ptlrpc_recovery_cb_t recover)
 {
         int rc;
         ENTRY;
index 35a5360..541e3e1 100644 (file)
@@ -597,7 +597,7 @@ static int ost_setup(struct obd_device *obddev, obd_count len, void *buf)
                 GOTO(error_dec, err = -EINVAL);
         }
 
-        err = obd_connect(&ost->ost_conn, tgt, NULL);
+        err = obd_connect(&ost->ost_conn, tgt, NULL, NULL, NULL);
         if (err) {
                 CERROR("fail to connect to device %d\n", data->ioc_dev);
                 GOTO(error_dec, err = -EINVAL);
index 124fd23..a5528fd 100644 (file)
@@ -23,6 +23,7 @@
 #define DEBUG_SUBSYSTEM S_RPC
 
 #include <linux/obd_support.h>
+#include <linux/obd_class.h>
 #include <linux/lustre_net.h>
 
 static spinlock_t conn_lock;
index f0fe5ca..d8ace91 100644 (file)
@@ -51,6 +51,10 @@ void recovd_conn_manage(struct ptlrpc_connection *conn,
 {
         struct recovd_data *rd = &conn->c_recovd_data;
         ENTRY;
+        if (!recovd || !recover) {
+                EXIT;
+                return;
+        }
 
         if (!list_empty(&rd->rd_managed_chain)) {
                 if (rd->rd_recovd == recovd && rd->rd_recover == recover) {
index fbece03..25d6449 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/obd_class.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_ha.h>
+#include <linux/lustre_net.h>
 #include <linux/init.h>
 
 extern int ptlrpc_init_portals(void);
@@ -153,13 +154,19 @@ int connmgr_iocontrol(long cmd, struct lustre_handle *hdl, int len, void *karg,
         RETURN(rc);
 }
 
+static int connmgr_connect(struct lustre_handle *conn, struct obd_device *src,
+                           obd_uuid_t cluuid, struct recovd_obd *recovd,
+                           ptlrpc_recovery_cb_t recover)
+{
+        return class_connect(conn, src, cluuid);
+}
 
 /* use obd ops to offer management infrastructure */
 static struct obd_ops recovd_obd_ops = {
         o_setup:       connmgr_setup,
         o_cleanup:     connmgr_cleanup,
         o_iocontrol:   connmgr_iocontrol,
-        o_connect:     class_connect,
+        o_connect:     connmgr_connect,
         o_disconnect:  class_disconnect
 };
 
index c5eb61f..b768f5d 100644 (file)
@@ -1,20 +1,20 @@
 <?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE lustre>
 <lustre>
   <ldlm name='ldlm' uuid='ldlm_UUID'/>
-  <node name='localhost' uuid='localhost_UUID'>
+  <node uuid='localhost_UUID' name='localhost'>
     <profile>
       <ldlm_ref uuidref='ldlm_UUID'/>
       <network_ref uuidref='NET_localhost_tcp_UUID'/>
       <mds_ref uuidref='mds1_UUID'/>
-      <lov_ref uuidref='lov1_UUID'/>
+      <lovconfig_ref uuidref='LVCFG_lov1_UUID'/>
       <obd_ref uuidref='OBD_localhost_UUID'/>
       <ost_ref uuidref='OST_localhost_UUID'/>
       <obd_ref uuidref='OBD_localhost_2_UUID'/>
       <ost_ref uuidref='OST_localhost_2_UUID'/>
       <mountpoint_ref uuidref='MNT_localhost_UUID'/>
-      <mdc_ref uuidref='MDC_mds1_UUID'/>
     </profile>
-    <network name='NET_localhost_tcp' uuid='NET_localhost_tcp_UUID' type='tcp'>
+    <network type='tcp' uuid='NET_localhost_tcp_UUID' name='NET_localhost_tcp'>
       <server>localhost</server>
       <port>988</port>
     </network>
     <network_ref uuidref='NET_localhost_tcp_UUID'/>
     <node_ref uuidref='localhost_UUID'/>
   </mds>
-  <mdc name='MDC_mds1' uuid='MDC_mds1_UUID'>
+  <lov uuid='lov1_UUID' name='lov1'>
     <mds_ref uuidref='mds1_UUID'/>
-  </mdc>
-  <lov name='lov1' uuid='lov1_UUID'>
-    <mds_ref uuidref='mds1_UUID'/>
-    <devices stripeoffset='0' stripesize='4096' pattern='0'>
+    <devices pattern='0' stripesize='65536' stripecount='0'>
       <osc_ref uuidref='OSC_localhost_UUID'/>
       <osc_ref uuidref='OSC_localhost_2_UUID'/>
     </devices>
   </lov>
-  <obd uuid='OBD_localhost_UUID' name='OBD_localhost' type='obdfilter'>
+  <lovconfig uuid='LVCFG_lov1_UUID' name='LVCFG_lov1'>
+    <lov_ref uuidref='lov1_UUID'/>
+  </lovconfig>
+  <obd type='obdfilter' uuid='OBD_localhost_UUID' name='OBD_localhost'>
     <fstype>extN</fstype>
     <device size='100000'>/tmp/ost1</device>
     <autoformat>no</autoformat>
     <network_ref uuidref='NET_localhost_tcp_UUID'/>
     <obd_ref uuidref='OBD_localhost_UUID'/>
   </ost>
-  <obd name='OBD_localhost_2' uuid='OBD_localhost_2_UUID' type='obdfilter'>
+  <obd type='obdfilter' uuid='OBD_localhost_2_UUID' name='OBD_localhost_2'>
     <fstype>extN</fstype>
     <device size='100000'>/tmp/ost2</device>
     <autoformat>no</autoformat>
   </obd>
-  <osc name='OSC_localhost_2' uuid='OSC_localhost_2_UUID'>
+  <osc uuid='OSC_localhost_2_UUID' name='OSC_localhost_2'>
     <ost_ref uuidref='OST_localhost_2_UUID'/>
     <obd_ref uuidref='OBD_localhost_2_UUID'/>
   </osc>
-  <ost name='OST_localhost_2' uuid='OST_localhost_2_UUID'>
+  <ost uuid='OST_localhost_2_UUID' name='OST_localhost_2'>
     <network_ref uuidref='NET_localhost_tcp_UUID'/>
     <obd_ref uuidref='OBD_localhost_2_UUID'/>
   </ost>
   <mountpoint name='MNT_localhost' uuid='MNT_localhost_UUID'>
-    <mdc_ref uuidref='MDC_mds1_UUID'/>
+    <mds_ref uuidref='mds1_UUID'/>
     <osc_ref uuidref='lov1_UUID'/>
     <path>/mnt/lustre</path>
   </mountpoint>