From 14acb2f329aa2d575362a76ce85a03084109b315 Mon Sep 17 00:00:00 2001 From: shadow Date: Sat, 6 Jun 2009 03:44:36 +0000 Subject: [PATCH] assign import for fake request. Branch b1_8 b=18357 i=johann i=tappro --- lustre/include/lustre_net.h | 3 ++- lustre/osc/osc_create.c | 4 +++- lustre/ptlrpc/client.c | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 90fdb85..6734dec 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -852,7 +852,8 @@ ptlrpc_init_rq_pool(int, int, void (*populate_pool)(struct ptlrpc_request_pool *, int)); void ptlrpc_at_set_req_timeout(struct ptlrpc_request *req); -struct ptlrpc_request *ptlrpc_prep_fakereq(unsigned int timeout, +struct ptlrpc_request *ptlrpc_prep_fakereq(struct obd_import *imp, + unsigned int timeout, int (*interpreter)(struct ptlrpc_request *, void *, int)); void ptlrpc_fakereq_finished(struct ptlrpc_request *req); diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index c3f7cf6..03a167b 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -459,7 +459,9 @@ int osc_create_async(struct obd_export *exp, struct obd_info *oinfo, LASSERT((*ea) != NULL); - fake_req = ptlrpc_prep_fakereq(osc_create_timeout, async_create_interpret); + fake_req = ptlrpc_prep_fakereq(oscc->oscc_obd->u.cli.cl_import, + osc_create_timeout, + async_create_interpret); if (fake_req == NULL) { rc = oinfo->oi_cb_up(oinfo, -ENOMEM); RETURN(-ENOMEM); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 207e472..3895f0d 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -617,7 +617,8 @@ ptlrpc_prep_req(struct obd_import *imp, __u32 version, int opcode, int count, NULL); } -struct ptlrpc_request *ptlrpc_prep_fakereq(unsigned int timeout, +struct ptlrpc_request *ptlrpc_prep_fakereq(struct obd_import *imp, + unsigned int timeout, int (*interpreter)(struct ptlrpc_request *, void *, int)) { @@ -632,7 +633,7 @@ struct ptlrpc_request *ptlrpc_prep_fakereq(unsigned int timeout, request->rq_send_state = LUSTRE_IMP_FULL; request->rq_type = PTL_RPC_MSG_REQUEST; - request->rq_import = NULL; + request->rq_import = class_import_get(imp); request->rq_export = NULL; request->rq_sent = cfs_time_current_sec(); -- 1.8.3.1