-static struct mdt_handler mdt_sec_ctx_ops[] = {
-DEF_SEC_HDL(0, SEC_CTX_INIT, mdt_sec_ctx_handle),
-DEF_SEC_HDL(0, SEC_CTX_INIT_CONT,mdt_sec_ctx_handle),
-DEF_SEC_HDL(0, SEC_CTX_FINI, mdt_sec_ctx_handle)
-};
-
-#define DEF_QUOTA_HDL(flags, name, fn) \
- DEFINE_RPC_HANDLER(QUOTA_DQACQ, flags, name, fn, &RQF_ ## name)
-
-static struct mdt_handler mdt_quota_ops[] = {
-DEF_QUOTA_HDL(HABEO_REFERO, QUOTA_DQACQ, mdt_quota_dqacq),
-};
-
-struct mdt_opc_slice mdt_regular_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 = LLOG_ORIGIN_HANDLE_CREATE,
- .mos_opc_end = LLOG_LAST_OPC,
- .mos_hs = mdt_llog_ops
- },
- {
- .mos_opc_start = SEC_CTX_INIT,
- .mos_opc_end = SEC_LAST_OPC,
- .mos_hs = mdt_sec_ctx_ops
- },
- {
- .mos_opc_start = QUOTA_DQACQ,
- .mos_opc_end = QUOTA_LAST_OPC,
- .mos_hs = mdt_quota_ops
- },
- {
- .mos_hs = NULL
- }
-};
-
-/* Readpage/readdir handlers */
-static struct mdt_handler mdt_readpage_ops[] = {
-DEF_MDT_HDL(0, MDS_CONNECT, mdt_connect),
-DEF_MDT_HDL(HABEO_CORPUS | HABEO_REFERO, MDS_READPAGE, mdt_readpage),
-/* XXX: this is ugly and should be fixed one day, see mdc_close() for
- * detailed comments. --umka */
-DEF_MDT_HDL(HABEO_CORPUS, MDS_CLOSE, mdt_close),
-DEF_MDT_HDL(HABEO_CORPUS, MDS_DONE_WRITING, mdt_done_writing),
-};
-
-static struct mdt_opc_slice mdt_readpage_handlers[] = {
- {
- .mos_opc_start = MDS_GETATTR,
- .mos_opc_end = MDS_LAST_OPC,
- .mos_hs = mdt_readpage_ops
- },
- {
- .mos_opc_start = OBD_FIRST_OPC,
- .mos_opc_end = OBD_LAST_OPC,
- .mos_hs = mdt_obd_ops
- },
- {
- .mos_hs = NULL
- }
-};
-
-/* 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);
-}
-
-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);
-}