From: alex Date: Sun, 7 Aug 2005 16:28:09 +0000 (+0000) Subject: b=7267,7034 X-Git-Tag: v1_7_100~968 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=22b9090b475873ba163cdbee29bbaeb6977a38e7;p=fs%2Flustre-release.git b=7267,7034 - dedicated threads for serving OST_DESTROY and MDS_CLOSE --- diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 576186f..23902f4 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -120,6 +120,8 @@ #define MGMT_CLI_REPLY_PORTAL 27 #define GKS_REQUEST_PORTAL 28 #define GKC_REPLY_PORTAL 29 +#define MDS_CLOSE_PORTAL 30 +#define OST_DESTROY_PORTAL 31 #define SVC_KILLED 1 #define SVC_EVENT 2 diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index fcc8d8d..b53949a 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -343,6 +343,7 @@ struct mds_obd { struct ptlrpc_service *mds_service; struct ptlrpc_service *mds_setattr_service; struct ptlrpc_service *mds_readpage_service; + struct ptlrpc_service *mds_close_service; struct super_block *mds_sb; struct vfsmount *mds_vfsmnt; struct dentry *mds_id_de; @@ -453,6 +454,7 @@ struct ost_obd { spinlock_t ost_lock; struct ptlrpc_service *ost_service; struct ptlrpc_service *ost_create_service; + struct ptlrpc_service *ost_destroy_service; struct obd_service_time ost_stimes[6]; }; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 8bed91e..550fbd5 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -658,6 +658,7 @@ int mdc_close(struct obd_export *exp, struct obdo *oa, MDS_CLOSE, 3, reqsize, NULL); if (req == NULL) GOTO(out, rc = -ENOMEM); + req->rq_request_portal = MDS_CLOSE_PORTAL; //reqsize[0] = lustre_secdesc_size(); //lustre_pack_secdesc(req, reqsize[0]); diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index e807ae8..84cc5d1 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -4472,8 +4472,26 @@ static int mdt_setup(struct obd_device *obd, obd_count len, void *buf) if (rc) GOTO(err_thread3, rc); + mds->mds_close_service = + ptlrpc_init_svc(MDS_NBUFS, MDS_BUFSIZE, MDS_MAXREQSIZE, + MDS_CLOSE_PORTAL, MDC_REPLY_PORTAL, + MDS_SERVICE_WATCHDOG_TIMEOUT, + mds_handle, "mds_close", + obd->obd_proc_entry); + if (!mds->mds_close_service) { + CERROR("failed to start close service\n"); + GOTO(err_thread3, rc = -ENOMEM); + } + + rc = ptlrpc_start_n_threads(obd, mds->mds_close_service, + MDT_NUM_THREADS, "ll_mdt_clos"); + + if (rc) + GOTO(err_thread4, rc); RETURN(0); +err_thread4: + ptlrpc_unregister_service(mds->mds_close_service); err_thread3: ptlrpc_unregister_service(mds->mds_readpage_service); err_thread2: @@ -4488,6 +4506,9 @@ static int mdt_cleanup(struct obd_device *obd, int flags) struct mds_obd *mds = &obd->u.mds; ENTRY; + ptlrpc_stop_all_threads(mds->mds_close_service); + ptlrpc_unregister_service(mds->mds_close_service); + ptlrpc_stop_all_threads(mds->mds_readpage_service); ptlrpc_unregister_service(mds->mds_readpage_service); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 6fc5d02..369145b 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -498,6 +498,7 @@ static int osc_destroy(struct obd_export *exp, struct obdo *oa, OST_DESTROY, 1, &size, NULL); if (!request) RETURN(-ENOMEM); + request->rq_request_portal = OST_DESTROY_PORTAL; body = lustre_msg_buf(request->rq_reqmsg, 0, sizeof (*body)); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 96481c7..e59b2e9 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -1319,8 +1319,25 @@ static int ost_setup(struct obd_device *obd, obd_count len, void *buf) if (rc) GOTO(out_create, rc = -EINVAL); + ost->ost_destroy_service = + ptlrpc_init_svc(OST_NBUFS, OST_BUFSIZE, OST_MAXREQSIZE, + OST_DESTROY_PORTAL, OSC_REPLY_PORTAL, 30000, + ost_handle, "ost_destroy", + obd->obd_proc_entry); + if (ost->ost_destroy_service == NULL) { + CERROR("failed to start service\n"); + GOTO(out_create, rc = -ENOMEM); + } + + rc = ptlrpc_start_n_threads(obd, ost->ost_destroy_service, + OST_NUM_THREADS, "ll_dstr_ost"); + if (rc) + GOTO(out_destroy, rc = -EINVAL); + RETURN(0); +out_destroy: + ptlrpc_unregister_service(ost->ost_destroy_service); out_create: ptlrpc_unregister_service(ost->ost_create_service); out_service: @@ -1348,6 +1365,9 @@ static int ost_cleanup(struct obd_device *obd, int flags) ptlrpc_stop_all_threads(ost->ost_create_service); ptlrpc_unregister_service(ost->ost_create_service); + ptlrpc_stop_all_threads(ost->ost_destroy_service); + ptlrpc_unregister_service(ost->ost_destroy_service); + #ifdef ENABLE_GSS /* XXX */ lgss_svc_cache_purge_all();