Whamcloud - gitweb
Fix a few compiler warnings.
authorbraam <braam>
Sun, 30 Jun 2002 08:03:40 +0000 (08:03 +0000)
committerbraam <braam>
Sun, 30 Jun 2002 08:03:40 +0000 (08:03 +0000)
lustre/mdc/mdc_request.c
lustre/obdclass/genops.c
lustre/osc/osc_request.c

index b9b672f..2b805f5 100644 (file)
@@ -744,12 +744,12 @@ static int mdc_connect(struct lustre_handle *conn, struct obd_device *obd)
         MOD_INC_USE_COUNT;
         rc = class_connect(conn, obd);
         if (rc) 
-                GOTO(out, rc);
+                RETURN(rc); 
 
         request = ptlrpc_prep_req(mdc->mdc_client, mdc->mdc_conn,
                                   MDS_CONNECT, 1, &size, &tmp);
         if (!request)
-                RETURN(-ENOMEM);
+                GOTO(out_disco, -ENOMEM);
 
         request->rq_replen = lustre_msg_size(0, NULL);
 
@@ -762,8 +762,11 @@ static int mdc_connect(struct lustre_handle *conn, struct obd_device *obd)
         mdc->mdc_connh.cookie = request->rq_repmsg->cookie;
 
         EXIT;
+
  out:
         ptlrpc_free_req(request);
+ out_disco:
+        class_disconnect(conn);
         if (rc) 
                 MOD_DEC_USE_COUNT;
         return rc;
index 591ee3f..34e63eb 100644 (file)
@@ -52,7 +52,7 @@ struct obd_type *class_nm_to_type(char *nm)
         if ( !type ) {
                 if ( !request_module(nm) ) {
                         CDEBUG(D_INFO, "Loaded module '%s'\n", nm);
-                        type = obd_search_type(nm);
+                        type = class_search_type(nm);
                 } else {
                         CDEBUG(D_INFO, "Can't load module '%s'\n", nm);
                 }
@@ -297,7 +297,7 @@ int class_multi_setup(struct obd_device *obddev, uint32_t len, void *data)
                 if (tmp < 0 || tmp >= MAX_OBD_DEVICES) { 
                         CERROR("Trying to sub dev %d  - dev no too large\n", 
                                tmp);
-                        GOTO(err_disconnect, rc); 
+                        GOTO(err_disconnect, rc  = -EINVAL); 
                 }
 
                 rc = obd_connect(&obddev->obd_multi_conn[count], &obd_dev[tmp]);
index 08ab867..7a34b91 100644 (file)
@@ -67,13 +67,13 @@ static int osc_connect(struct lustre_handle *conn, struct obd_device *obd)
         MOD_INC_USE_COUNT;
         rc = class_connect(conn, obd);
         if (rc) 
-                GOTO(out, rc);
+                RETURN(rc); 
 
         osc_obd2cl(obd, &cl, &connection);
         request = ptlrpc_prep_req(osc->osc_client, osc->osc_conn, 
                                   OST_CONNECT, 1, &size, &tmp);
         if (!request)
-                RETURN(-ENOMEM);
+                GOTO(out_disco, -ENOMEM);
 
         request->rq_replen = lustre_msg_size(0, NULL);
 
@@ -91,6 +91,8 @@ static int osc_connect(struct lustre_handle *conn, struct obd_device *obd)
         EXIT;
  out:
         ptlrpc_free_req(request);
+ out_disco:
+        class_disconnect(conn); 
         if (rc)
                 MOD_DEC_USE_COUNT;
         return rc;