Whamcloud - gitweb
LU-3751 ost: disable OUT_PORTAL request handler on OST.
[fs/lustre-release.git] / lustre / ost / ost_handler.c
index 5b7e34e..405d69c 100644 (file)
@@ -1348,8 +1348,10 @@ static int lock_region(struct obd_export *exp, struct obdo *oa,
                return -ENOMEM;
 
        rc = ost_lock_get(exp, oa, begin, end - begin, &region->lh, LCK_PR, 0);
-       if (rc)
+       if (rc) {
+               OBD_FREE_PTR(region);
                return rc;
+       }
 
        CDEBUG(D_OTHER, "ost lock [%llu,%llu], lh=%p\n",
               begin, end, &region->lh);
@@ -1817,15 +1819,6 @@ int ost_msg_check_version(struct lustre_msg *msg)
                                lustre_msg_get_version(msg),
                                LUSTRE_OBD_VERSION);
                 break;
-       case SEQ_QUERY:
-               /* Note: client always use MDS_VERSION for FID request */
-               rc = lustre_msg_check_version(msg, LUSTRE_MDS_VERSION);
-               if (rc)
-                       CERROR("bad opc %u version %08x, expecting %08x\n",
-                              lustre_msg_get_opc(msg),
-                              lustre_msg_get_version(msg),
-                              LUSTRE_MDS_VERSION);
-               break;
         case OST_CREATE:
         case OST_DESTROY:
         case OST_GETATTR:
@@ -2461,10 +2454,6 @@ int ost_handle(struct ptlrpc_request *req)
                 req_capsule_set(&req->rq_pill, &RQF_OST_GET_INFO_GENERIC);
                 rc = ost_get_info(req->rq_export, req);
                 break;
-       case SEQ_QUERY:
-               CDEBUG(D_INODE, "seq\n");
-               rc = seq_handle(req);
-               break;
         case OST_QUOTACHECK:
                 CDEBUG(D_INODE, "quotacheck\n");
                 req_capsule_set(&req->rq_pill, &RQF_OST_QUOTACHECK);
@@ -2784,7 +2773,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .cc_pattern          = oss_cpts,
                },
                .psc_ops                = {
-                       .so_req_handler         = ost_handle,
+                       .so_req_handler         = tgt_request_handle,
                        .so_req_printer         = target_print_req,
                        .so_hpreq_handler       = NULL,
                },
@@ -2798,9 +2787,55 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                GOTO(out_io, rc);
        }
 
-        ping_evictor_start();
+#if 0
+       /* Object update service */
+       memset(&svc_conf, 0, sizeof(svc_conf));
+       svc_conf = (typeof(svc_conf)) {
+               .psc_name               = "ost_out",
+               .psc_watchdog_factor    = OSS_SERVICE_WATCHDOG_FACTOR,
+               .psc_buf                = {
+                       .bc_nbufs               = OST_NBUFS,
+                       .bc_buf_size            = OUT_BUFSIZE,
+                       .bc_req_max_size        = OUT_MAXREQSIZE,
+                       .bc_rep_max_size        = OUT_MAXREPSIZE,
+                       .bc_req_portal          = OUT_PORTAL,
+                       .bc_rep_portal          = OSC_REPLY_PORTAL,
+               },
+               /*
+                * We'd like to have a mechanism to set this on a per-device
+                * basis, but alas...
+                */
+               .psc_thr                = {
+                       .tc_thr_name            = "ll_ost_out",
+                       .tc_thr_factor          = OSS_CR_THR_FACTOR,
+                       .tc_nthrs_init          = OSS_CR_NTHRS_INIT,
+                       .tc_nthrs_base          = OSS_CR_NTHRS_BASE,
+                       .tc_nthrs_max           = OSS_CR_NTHRS_MAX,
+                       .tc_nthrs_user          = oss_num_create_threads,
+                       .tc_cpu_affinity        = 1,
+                       .tc_ctx_tags            = LCT_DT_THREAD,
+               },
+               .psc_cpt                = {
+                       .cc_pattern             = oss_cpts,
+               },
+               .psc_ops                = {
+                       .so_req_handler         = tgt_request_handle,
+                       .so_req_printer         = target_print_req,
+                       .so_hpreq_handler       = NULL,
+               },
+       };
+       ost->ost_out_service = ptlrpc_register_service(&svc_conf,
+                                                      obd->obd_proc_entry);
+       if (IS_ERR(ost->ost_out_service)) {
+               rc = PTR_ERR(ost->ost_out_service);
+               CERROR("failed to start out service: %d\n", rc);
+               ost->ost_out_service = NULL;
+               GOTO(out_seq, rc);
+       }
+#endif
+       ping_evictor_start();
 
-        RETURN(0);
+       RETURN(0);
 out_io:
        ptlrpc_unregister_service(ost->ost_io_service);
        ost->ost_io_service = NULL;
@@ -2831,10 +2866,14 @@ static int ost_cleanup(struct obd_device *obd)
        ptlrpc_unregister_service(ost->ost_create_service);
        ptlrpc_unregister_service(ost->ost_io_service);
        ptlrpc_unregister_service(ost->ost_seq_service);
+#if 0
+       ptlrpc_unregister_service(ost->ost_out_service);
+#endif
        ost->ost_service = NULL;
        ost->ost_create_service = NULL;
        ost->ost_io_service = NULL;
        ost->ost_seq_service = NULL;
+       ost->ost_out_service = NULL;
 
        mutex_unlock(&ost->ost_health_mutex);