Whamcloud - gitweb
LU-1346 libcfs: tcpip/time/type related cleanup
[fs/lustre-release.git] / lustre / mdt / mdt_mds.c
index ab00870..7c7d95e 100644 (file)
@@ -49,7 +49,6 @@
 /* lu2dt_dev() */
 #include <dt_object.h>
 #include <lustre_mds.h>
-#include <lustre_mdt.h>
 #include "mdt_internal.h"
 #include <lustre_quota.h>
 #include <lustre_acl.h>
@@ -269,84 +268,6 @@ static struct mdt_opc_slice mdt_readpage_handlers[] = {
        }
 };
 
-/* Sequence service handlers */
-#define DEF_SEQ_HDL(flags, name, fn)                                   \
-       DEFINE_RPC_HANDLER(SEQ_QUERY, flags, name, fn, &RQF_ ## name)
-
-static struct mdt_handler mdt_seq_ops[] = {
-DEF_SEQ_HDL(0,                         SEQ_QUERY,        (void *)seq_query),
-};
-
-struct mdt_opc_slice mdt_seq_handlers[] = {
-       {
-               .mos_opc_start = SEQ_QUERY,
-               .mos_opc_end   = SEQ_LAST_OPC,
-               .mos_hs = mdt_seq_ops
-       },
-       {
-               .mos_hs = NULL
-       }
-};
-
-/* FID Location Database handlers */
-#define DEF_FLD_HDL(flags, name, fn)                                   \
-       DEFINE_RPC_HANDLER(FLD_QUERY, flags, name, fn, &RQF_ ## name)
-
-static struct mdt_handler mdt_fld_ops[] = {
-DEF_FLD_HDL(0,                         FLD_QUERY,        (void *)fld_query),
-};
-
-struct mdt_opc_slice mdt_fld_handlers[] = {
-       {
-               .mos_opc_start = FLD_QUERY,
-               .mos_opc_end   = FLD_LAST_OPC,
-               .mos_hs = mdt_fld_ops
-       },
-       {
-               .mos_hs = NULL
-       }
-};
-
-/* Request with a format known in advance */
-#define DEF_UPDATE_HDL(flags, name, fn)                                        \
-       DEFINE_RPC_HANDLER(UPDATE_OBJ, flags, name, fn, &RQF_ ## name)
-
-#define target_handler mdt_handler
-static struct target_handler out_ops[] = {
-       DEF_UPDATE_HDL(MUTABOR,         UPDATE_OBJ,     out_handle),
-};
-
-static struct mdt_opc_slice update_handlers[] = {
-       {
-               .mos_opc_start = MDS_GETATTR,
-               .mos_opc_end   = MDS_LAST_OPC,
-               .mos_hs        = mdt_mds_ops
-       },
-       {
-               .mos_opc_start = OBD_PING,
-               .mos_opc_end   = OBD_LAST_OPC,
-               .mos_hs        = mdt_obd_ops
-       },
-       {
-               .mos_opc_start = LDLM_ENQUEUE,
-               .mos_opc_end   = LDLM_LAST_OPC,
-               .mos_hs        = mdt_dlm_ops
-       },
-       {
-               .mos_opc_start = SEC_CTX_INIT,
-               .mos_opc_end   = SEC_LAST_OPC,
-               .mos_hs        = mdt_sec_ctx_ops
-       },
-       {
-               .mos_opc_start = UPDATE_OBJ,
-               .mos_opc_end   = UPDATE_LAST_OPC,
-               .mos_hs        = out_ops
-       },
-       {
-               .mos_hs        = NULL
-       }
-};
-
 static int mds_regular_handle(struct ptlrpc_request *req)
 {
        return mdt_handle_common(req, mdt_regular_handlers);
@@ -357,26 +278,6 @@ static int mds_readpage_handle(struct ptlrpc_request *req)
        return mdt_handle_common(req, mdt_readpage_handlers);
 }
 
-static int mds_mdsc_handle(struct ptlrpc_request *req)
-{
-       return mdt_handle_common(req, mdt_seq_handlers);
-}
-
-static int mdt_out_handle(struct ptlrpc_request *req)
-{
-       return mdt_handle_common(req, update_handlers);
-}
-
-static int mds_mdss_handle(struct ptlrpc_request *req)
-{
-       return mdt_handle_common(req, mdt_seq_handlers);
-}
-
-static int mds_fld_handle(struct ptlrpc_request *req)
-{
-       return mdt_handle_common(req, mdt_fld_handlers);
-}
-
 /* device init/fini methods */
 static void mds_stop_ptlrpc_service(struct mds_device *m)
 {
@@ -562,10 +463,10 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                .psc_watchdog_factor    = MDT_SERVICE_WATCHDOG_FACTOR,
                .psc_buf                = {
                        .bc_nbufs               = MDS_NBUFS,
-                       .bc_buf_size            = MDS_OUT_BUFSIZE,
-                       .bc_req_max_size        = MDS_OUT_MAXREQSIZE,
-                       .bc_rep_max_size        = MDS_OUT_MAXREPSIZE,
-                       .bc_req_portal          = MDS_MDS_PORTAL,
+                       .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          = MDC_REPLY_PORTAL,
                },
                /*
@@ -586,7 +487,7 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .cc_pattern             = mds_num_cpts,
                },
                .psc_ops                = {
-                       .so_req_handler         = mdt_out_handle,
+                       .so_req_handler         = tgt_request_handle,
                        .so_req_printer         = target_print_req,
                        .so_hpreq_handler       = NULL,
                },
@@ -621,7 +522,7 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .tc_ctx_tags            = LCT_MD_THREAD,
                },
                .psc_ops                = {
-                       .so_req_handler         = mds_mdsc_handle,
+                       .so_req_handler         = tgt_request_handle,
                        .so_req_printer         = target_print_req,
                        .so_hpreq_handler       = NULL,
                },
@@ -657,7 +558,7 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .tc_ctx_tags            = LCT_MD_THREAD | LCT_DT_THREAD
                },
                .psc_ops                = {
-                       .so_req_handler         = mds_mdss_handle,
+                       .so_req_handler         = tgt_request_handle,
                        .so_req_printer         = target_print_req,
                        .so_hpreq_handler       = NULL,
                },
@@ -688,10 +589,10 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .tc_thr_name            = LUSTRE_MDT_NAME "_fld",
                        .tc_nthrs_init          = MDS_OTHR_NTHRS_INIT,
                        .tc_nthrs_max           = MDS_OTHR_NTHRS_MAX,
-                       .tc_ctx_tags            = LCT_DT_THREAD | LCT_MD_THREAD
+                       .tc_ctx_tags            = LCT_DT_THREAD | LCT_MD_THREAD,
                },
                .psc_ops                = {
-                       .so_req_handler         = mds_fld_handle,
+                       .so_req_handler         = tgt_request_handle,
                        .so_req_printer         = target_print_req,
                        .so_hpreq_handler       = NULL,
                },
@@ -778,7 +679,6 @@ static struct lu_device *mds_device_alloc(const struct lu_env *env,
                l = ERR_PTR(rc);
                return l;
        }
-
        return l;
 }