From cd299fe13235592104cc9f696706554237f9f544 Mon Sep 17 00:00:00 2001 From: braam Date: Wed, 21 Aug 2002 03:15:21 +0000 Subject: [PATCH] - add a name to ptlrpc_svc_init in preparation for eliminating request->rq_obd - fix typo in osc_enqueue --- lustre/include/linux/lustre_net.h | 5 +++-- lustre/ldlm/ldlm_lockd.c | 2 +- lustre/llite/rw.c | 2 -- lustre/mds/handler.c | 3 ++- lustre/osc/osc_request.c | 2 +- lustre/ost/ost_handler.c | 3 ++- lustre/ptlrpc/rpc.c | 3 ++- lustre/ptlrpc/service.c | 9 +++++++-- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 0c50c99..8e43c92 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -166,7 +166,7 @@ struct ptlrpc_bulk_desc { ptl_handle_md_t b_md_h; ptl_handle_me_t b_me_h; - struct iovec b_iov[16]; /* self-sized pre-allocated iov */ + struct iovec b_iov[16]; /* self-sized pre-allocated iov */ }; struct ptlrpc_thread { @@ -203,6 +203,7 @@ struct ptlrpc_service { struct list_head srv_reqs; struct list_head srv_threads; int (*srv_handler)(struct ptlrpc_request *req); + char *srv_name; /* only statically allocated strings here; we don't clean them */ }; static inline void ptlrpc_hdl2req(struct ptlrpc_request *req, struct lustre_handle *h) @@ -266,7 +267,7 @@ int ptlrpc_check_status(struct ptlrpc_request *req, int err); /* rpc/service.c */ struct ptlrpc_service * ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, - svc_handler_t); + svc_handler_t, char *name); void ptlrpc_stop_all_threads(struct ptlrpc_service *svc); int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc, char *name); diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 0fca880..f62bb91 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -465,7 +465,7 @@ static int ldlm_setup(struct obd_device *obddev, obd_count len, void *buf) ldlm->ldlm_service = ptlrpc_init_svc(64 * 1024, LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, "self", - ldlm_callback_handler); + ldlm_callback_handler, "ldlm"); if (!ldlm->ldlm_service) GOTO(out_proc, rc = -ENOMEM); diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 924c1f3..23ff9ec 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -112,8 +112,6 @@ static int ll_prepare_write(struct file *file, struct page *page, unsigned from, /* prepare write should not read what lies beyond the end of the file */ - - rc = ll_brw(OBD_BRW_READ, inode, page, 0); EXIT; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 7cb1fd0..8d1d3c7 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1097,7 +1097,8 @@ static int mds_setup(struct obd_device *obddev, obd_count len, void *buf) } mds->mds_service = ptlrpc_init_svc(64 * 1024, MDS_REQUEST_PORTAL, - MDC_REPLY_PORTAL, "self",mds_handle); + MDC_REPLY_PORTAL, "self",mds_handle, + "mds"); if (!mds->mds_service) { CERROR("failed to start service\n"); GOTO(err_fs, rc = -EINVAL); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index feb1894..864d679 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -657,7 +657,7 @@ static int osc_enqueue(struct lustre_handle *connh, struct lov_stripe_md *md, /* This code must change if we ever stop passing an inode in as data */ /* This is ldlm and llite code. It makes me sad that it's in * osc_request.c --phil */ - lock = ldlm_handle2lock(&lockh); + lock = ldlm_handle2lock(lockh); if (lock) { /* Lock already has an extra ref from handle2lock */ l_lock(&obddev->obd_namespace->ns_lock); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 35002fb..b82912d 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -607,7 +607,8 @@ static int ost_setup(struct obd_device *obddev, obd_count len, void *buf) } ost->ost_service = ptlrpc_init_svc(64 * 1024, OST_REQUEST_PORTAL, - OSC_REPLY_PORTAL, "self",ost_handle); + OSC_REPLY_PORTAL, "self",ost_handle, + "ost"); if (!ost->ost_service) { CERROR("failed to start service\n"); GOTO(error_disc, err = -EINVAL); diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index 2459760..9121f22 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -53,7 +53,8 @@ int connmgr_setup(struct obd_device *obddev, obd_count len, void *buf) recovd->recovd_service = ptlrpc_init_svc(16* 1024, CONNMGR_REQUEST_PORTAL, CONNMGR_REPLY_PORTAL, - "self", connmgr_handle); + "self", connmgr_handle, + "connmgr"); if (!recovd->recovd_service) { CERROR("failed to start service\n"); GOTO(err_recovd, err = -ENOMEM); diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index b8ba771..4b71a4d 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -64,7 +64,7 @@ static int ptlrpc_check_event(struct ptlrpc_service *svc, struct ptlrpc_service * ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, - svc_handler_t handler) + svc_handler_t handler, char *name) { int err; int rc, i; @@ -77,6 +77,7 @@ ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, RETURN(NULL); } + service->srv_name = name; spin_lock_init(&service->srv_lock); INIT_LIST_HEAD(&service->srv_reqs); INIT_LIST_HEAD(&service->srv_threads); @@ -346,6 +347,7 @@ int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc, CLONE_VM | CLONE_FS | CLONE_FILES); if (rc < 0) { CERROR("cannot start thread\n"); + OBD_FREE(thread, sizeof(*thread)); RETURN(-EINVAL); } wait_event(thread->t_ctl_waitq, thread->t_flags & SVC_RUNNING); @@ -377,8 +379,11 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service) if (!list_empty(&service->srv_reqs)) { // XXX reply with errors and clean up CERROR("Request list not empty!\n"); + rc = -EBUSY; } OBD_FREE(service, sizeof(*service)); - return 0; + if (rc) + LBUG(); + return rc; } -- 1.8.3.1