From 1b1954c0e9a66688b5ae7b58e1722a6d75c6e5a8 Mon Sep 17 00:00:00 2001 From: braam Date: Sun, 30 Jun 2002 08:03:40 +0000 Subject: [PATCH] Fix a few compiler warnings. --- lustre/mdc/mdc_request.c | 7 +++++-- lustre/obdclass/genops.c | 4 ++-- lustre/osc/osc_request.c | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index b9b672f..2b805f5 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 591ee3f..34e63eb 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -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]); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 08ab867..7a34b91 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -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; -- 1.8.3.1