#define DEBUG_SUBSYSTEM S_OSC
#include <linux/module.h>
-#include <linux/random.h>
#include <linux/lustre_dlm.h>
#include <linux/obd_ost.h>
if (bulk[pages] == NULL)
continue;
kunmap(buf[pages]);
- OBD_FREE(bulk[pages], sizeof(**bulk));
+ ptlrpc_free_bulk(bulk[pages]);
}
}
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);
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;
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:
{
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);