X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_request.c;h=7b33e6c9e7b093e38ec44f5b5b998c498af1becc;hb=2ad1df3c62663ce61e82856ebe4f576f751d617d;hp=93923dee68b4aa5aaa86148509afdafa9b0ea634;hpb=36915bd9b0838c3344ab6dd7db2c8b74c0707484;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 93923de..7b33e6c 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -20,7 +20,6 @@ #define DEBUG_SUBSYSTEM S_OSC #include -#include #include #include @@ -359,7 +358,7 @@ int osc_sendpage(struct obd_conn *conn, struct ptlrpc_request *req, bulk = ptlrpc_prep_bulk(connection); if (bulk == NULL) - return -ENOMEM; + RETURN(-ENOMEM); bulk->b_buf = (void *)(unsigned long)src->addr; bulk->b_buflen = src->len; @@ -369,12 +368,12 @@ int osc_sendpage(struct obd_conn *conn, struct ptlrpc_request *req, CERROR("send_bulk failed: %d\n", rc); ptlrpc_free_bulk(bulk); LBUG(); - return rc; + RETURN(rc); } wait_event_interruptible(bulk->b_waitq, ptlrpc_check_bulk_sent(bulk)); - if (bulk->b_flags == PTL_RPC_INTR) { + if (bulk->b_flags & PTL_RPC_FL_INTR) { ptlrpc_free_bulk(bulk); RETURN(-EINTR); } @@ -457,7 +456,7 @@ int osc_brw_read(struct obd_conn *conn, obd_count num_oa, struct obdo **oa, if (bulk[pages] == NULL) continue; kunmap(buf[pages]); - OBD_FREE(bulk[pages], sizeof(**bulk)); + ptlrpc_free_bulk(bulk[pages]); } } @@ -558,7 +557,6 @@ int osc_brw(int rw, struct obd_conn *conn, obd_count num_oa, static int osc_setup(struct obd_device *obddev, obd_count len, void *buf) { struct osc_obd *osc = &obddev->u.osc; - __u32 ns_id; int rc; ENTRY; @@ -574,24 +572,14 @@ static int osc_setup(struct obd_device *obddev, obd_count len, void *buf) if (osc->osc_ldlm_client == NULL) GOTO(out_client, rc = -ENOMEM); - ptlrpc_init_client(NULL, OST_REQUEST_PORTAL, OSC_REPLY_PORTAL, + ptlrpc_init_client(NULL, NULL, OST_REQUEST_PORTAL, OSC_REPLY_PORTAL, osc->osc_client); - ptlrpc_init_client(NULL, LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, + ptlrpc_init_client(NULL, NULL, LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, osc->osc_ldlm_client); - get_random_bytes(&ns_id, sizeof(ns_id)); - rc = ldlm_cli_namespace_new(obddev, osc->osc_ldlm_client, osc->osc_conn, - ns_id); - if (rc) { - CERROR("Couldn't create new namespace %u: %d\n", ns_id, rc); - GOTO(out_ldlm_client, rc); - } - MOD_INC_USE_COUNT; RETURN(0); - out_ldlm_client: - OBD_FREE(osc->osc_ldlm_client, sizeof(*osc->osc_ldlm_client)); out_client: OBD_FREE(osc->osc_client, sizeof(*osc->osc_client)); out_conn: @@ -603,7 +591,9 @@ static int osc_cleanup(struct obd_device * obddev) { struct osc_obd *osc = &obddev->u.osc; + ptlrpc_cleanup_client(osc->osc_client); OBD_FREE(osc->osc_client, sizeof(*osc->osc_client)); + ptlrpc_cleanup_client(osc->osc_ldlm_client); OBD_FREE(osc->osc_ldlm_client, sizeof(*osc->osc_ldlm_client)); ptlrpc_put_connection(osc->osc_conn);