Whamcloud - gitweb
- add a name to ptlrpc_svc_init in preparation for eliminating
authorbraam <braam>
Wed, 21 Aug 2002 03:15:21 +0000 (03:15 +0000)
committerbraam <braam>
Wed, 21 Aug 2002 03:15:21 +0000 (03:15 +0000)
request->rq_obd
- fix typo in osc_enqueue

lustre/include/linux/lustre_net.h
lustre/ldlm/ldlm_lockd.c
lustre/llite/rw.c
lustre/mds/handler.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/rpc.c
lustre/ptlrpc/service.c

index 0c50c99..8e43c92 100644 (file)
@@ -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);
index 0fca880..f62bb91 100644 (file)
@@ -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);
 
index 924c1f3..23ff9ec 100644 (file)
@@ -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;
index 7cb1fd0..8d1d3c7 100644 (file)
@@ -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);
index feb1894..864d679 100644 (file)
@@ -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);
index 35002fb..b82912d 100644 (file)
@@ -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);
index 2459760..9121f22 100644 (file)
@@ -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);
index b8ba771..4b71a4d 100644 (file)
@@ -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;
 }