X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosc%2Fosc_request.c;h=7b33e6c9e7b093e38ec44f5b5b998c498af1becc;hb=2ad1df3c62663ce61e82856ebe4f576f751d617d;hp=152f886a1b2b99a3b7542034f3df4012f244600f;hpb=4cdb7dadd04827cd28527c8b3532ea86f964bd68;p=fs%2Flustre-release.git diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 152f886..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 @@ -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]); } } @@ -520,7 +519,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa, GOTO(out, rc = -EINVAL); if (request->rq_repmsg->buflens[1] != pages * sizeof(struct niobuf)) { - CERROR("buffer length wrong (%d vs. %ld)\n", + CERROR("buffer length wrong (%d vs. %d)\n", request->rq_repmsg->buflens[1], pages * sizeof(struct niobuf)); GOTO(out, rc = -EINVAL); @@ -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);