From: John L. Hammond Date: Mon, 30 Apr 2018 14:08:48 +0000 (-0500) Subject: LU-10855 llog: remove obsolete llog handlers X-Git-Tag: 2.11.53~77 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=85011d372dfb50500ba5eef3f2fa79e5d6507539;p=fs%2Flustre-release.git LU-10855 llog: remove obsolete llog handlers Remove the obsolete llog RPC handling for cancel, close, and destroy. Remove llog handling from ldlm_callback_handler(). Remove the unused client side method llog_client_destroy(). Signed-off-by: John L. Hammond Change-Id: Ieab44f3796971a7d3c65d6044e4c0be4afb4b508 Reviewed-on: https://review.whamcloud.com/32202 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lu_target.h b/lustre/include/lu_target.h index 948d01b..5b6c1ae 100644 --- a/lustre/include/lu_target.h +++ b/lustre/include/lu_target.h @@ -412,8 +412,6 @@ int tgt_convert(struct tgt_session_info *tsi); int tgt_bl_callback(struct tgt_session_info *tsi); int tgt_cp_callback(struct tgt_session_info *tsi); int tgt_llog_open(struct tgt_session_info *tsi); -int tgt_llog_close(struct tgt_session_info *tsi); -int tgt_llog_destroy(struct tgt_session_info *tsi); int tgt_llog_read_header(struct tgt_session_info *tsi); int tgt_llog_next_block(struct tgt_session_info *tsi); int tgt_llog_prev_block(struct tgt_session_info *tsi); diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 6588312..2d36764 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2694,11 +2694,9 @@ static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes) {} /* ptlrpc/llog_server.c */ int llog_origin_handle_open(struct ptlrpc_request *req); -int llog_origin_handle_destroy(struct ptlrpc_request *req); int llog_origin_handle_prev_block(struct ptlrpc_request *req); int llog_origin_handle_next_block(struct ptlrpc_request *req); int llog_origin_handle_read_header(struct ptlrpc_request *req); -int llog_origin_handle_close(struct ptlrpc_request *req); /* ptlrpc/llog_client.c */ extern struct llog_operations llog_client_ops; diff --git a/lustre/include/lustre_req_layout.h b/lustre/include/lustre_req_layout.h index d48f6ea..a175677 100644 --- a/lustre/include/lustre_req_layout.h +++ b/lustre/include/lustre_req_layout.h @@ -226,13 +226,10 @@ extern struct req_format RQF_LDLM_BL_CALLBACK; extern struct req_format RQF_LDLM_GL_CALLBACK; extern struct req_format RQF_LDLM_GL_CALLBACK_DESC; /* LOG req_format */ -extern struct req_format RQF_LOG_CANCEL; extern struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE; -extern struct req_format RQF_LLOG_ORIGIN_HANDLE_DESTROY; extern struct req_format RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK; extern struct req_format RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK; extern struct req_format RQF_LLOG_ORIGIN_HANDLE_READ_HEADER; -extern struct req_format RQF_LLOG_ORIGIN_CONNECT; extern struct req_format RQF_CONNECT; diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 8e77f31..d368eca 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -2525,8 +2525,8 @@ struct cfg_marker { * Opcodes for multiple servers. */ enum obd_cmd { - OBD_PING = 400, - OBD_LOG_CANCEL, + OBD_PING = 400, + OBD_LOG_CANCEL, /* Obsolete since 1.5. */ OBD_QC_CALLBACK, /* not used since 2.4 */ OBD_IDX_READ, OBD_LAST_OPC @@ -2871,17 +2871,17 @@ struct llog_cookie { /** llog protocol */ enum llogd_rpc_ops { - LLOG_ORIGIN_HANDLE_CREATE = 501, - LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502, - LLOG_ORIGIN_HANDLE_READ_HEADER = 503, - LLOG_ORIGIN_HANDLE_WRITE_REC = 504, - LLOG_ORIGIN_HANDLE_CLOSE = 505, - LLOG_ORIGIN_CONNECT = 506, - LLOG_CATINFO = 507, /* deprecated */ - LLOG_ORIGIN_HANDLE_PREV_BLOCK = 508, - LLOG_ORIGIN_HANDLE_DESTROY = 509, /* for destroy llog object*/ - LLOG_LAST_OPC, - LLOG_FIRST_OPC = LLOG_ORIGIN_HANDLE_CREATE + LLOG_ORIGIN_HANDLE_CREATE = 501, + LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502, + LLOG_ORIGIN_HANDLE_READ_HEADER = 503, + LLOG_ORIGIN_HANDLE_WRITE_REC = 504, /* Obsolete by 2.1. */ + LLOG_ORIGIN_HANDLE_CLOSE = 505, /* Obsolete by 1.8. */ + LLOG_ORIGIN_CONNECT = 506, /* Obsolete by 2.4. */ + LLOG_CATINFO = 507, /* Obsolete by 2.3. */ + LLOG_ORIGIN_HANDLE_PREV_BLOCK = 508, + LLOG_ORIGIN_HANDLE_DESTROY = 509, /* Obsolete. */ + LLOG_LAST_OPC, + LLOG_FIRST_OPC = LLOG_ORIGIN_HANDLE_CREATE }; struct llogd_body { diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 45c3b67..92ee0c8 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2116,35 +2116,6 @@ static int ldlm_callback_handler(struct ptlrpc_request *req) rc = ldlm_handle_setinfo(req); ldlm_callback_reply(req, rc); RETURN(0); - case LLOG_ORIGIN_HANDLE_CREATE: - req_capsule_set(&req->rq_pill, &RQF_LLOG_ORIGIN_HANDLE_CREATE); - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) - RETURN(0); - rc = llog_origin_handle_open(req); - ldlm_callback_reply(req, rc); - RETURN(0); - case LLOG_ORIGIN_HANDLE_NEXT_BLOCK: - req_capsule_set(&req->rq_pill, - &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK); - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) - RETURN(0); - rc = llog_origin_handle_next_block(req); - ldlm_callback_reply(req, rc); - RETURN(0); - case LLOG_ORIGIN_HANDLE_READ_HEADER: - req_capsule_set(&req->rq_pill, - &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER); - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) - RETURN(0); - rc = llog_origin_handle_read_header(req); - ldlm_callback_reply(req, rc); - RETURN(0); - case LLOG_ORIGIN_HANDLE_CLOSE: - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LOGD_NET)) - RETURN(0); - rc = llog_origin_handle_close(req); - ldlm_callback_reply(req, rc); - RETURN(0); default: CERROR("unknown opcode %u\n", lustre_msg_get_opc(req->rq_reqmsg)); diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 8e93215..21587d2 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -1234,7 +1234,6 @@ static struct tgt_handler mgs_llog_handlers[] = { TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_CREATE, mgs_llog_open), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_NEXT_BLOCK, tgt_llog_next_block), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_READ_HEADER, tgt_llog_read_header), -TGT_LLOG_HDL_VAR(0, LLOG_ORIGIN_HANDLE_CLOSE, tgt_llog_close), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_PREV_BLOCK, tgt_llog_prev_block), }; diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index 36f6d537..ad8793e 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -87,11 +87,6 @@ static const struct req_msg_field *mgs_config_read_server[] = { &RMF_MGS_CONFIG_RES }; -static const struct req_msg_field *log_cancel_client[] = { - &RMF_PTLRPC_BODY, - &RMF_LOGCOOKIES -}; - static const struct req_msg_field *mdt_body_only[] = { &RMF_PTLRPC_BODY, &RMF_MDT_BODY @@ -575,11 +570,6 @@ static const struct req_msg_field *llog_log_hdr_only[] = { &RMF_LLOG_LOG_HDR }; -static const struct req_msg_field *llogd_conn_body_only[] = { - &RMF_PTLRPC_BODY, - &RMF_LLOGD_CONN_BODY -}; - static const struct req_msg_field *llog_origin_handle_next_block_server[] = { &RMF_PTLRPC_BODY, &RMF_LLOGD_BODY, @@ -820,13 +810,10 @@ static struct req_format *req_formats[] = { &RQF_LDLM_INTENT_GETXATTR, &RQF_LDLM_INTENT_QUOTA, &RQF_QUOTA_DQACQ, - &RQF_LOG_CANCEL, &RQF_LLOG_ORIGIN_HANDLE_CREATE, - &RQF_LLOG_ORIGIN_HANDLE_DESTROY, &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK, &RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK, &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER, - &RQF_LLOG_ORIGIN_CONNECT, &RQF_CONNECT, &RQF_LFSCK_NOTIFY, &RQF_LFSCK_QUERY, @@ -1354,10 +1341,6 @@ struct req_format RQF_FLD_READ = DEFINE_REQ_FMT0("FLD_READ", fld_read_client, fld_read_server); EXPORT_SYMBOL(RQF_FLD_READ); -struct req_format RQF_LOG_CANCEL = - DEFINE_REQ_FMT0("OBD_LOG_CANCEL", log_cancel_client, empty); -EXPORT_SYMBOL(RQF_LOG_CANCEL); - struct req_format RQF_MDS_QUOTACTL = DEFINE_REQ_FMT0("MDS_QUOTACTL", quotactl_only, quotactl_only); EXPORT_SYMBOL(RQF_MDS_QUOTACTL); @@ -1620,11 +1603,6 @@ struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE = llog_origin_handle_create_client, llogd_body_only); EXPORT_SYMBOL(RQF_LLOG_ORIGIN_HANDLE_CREATE); -struct req_format RQF_LLOG_ORIGIN_HANDLE_DESTROY = - DEFINE_REQ_FMT0("LLOG_ORIGIN_HANDLE_DESTROY", - llogd_body_only, llogd_body_only); -EXPORT_SYMBOL(RQF_LLOG_ORIGIN_HANDLE_DESTROY); - struct req_format RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK = DEFINE_REQ_FMT0("LLOG_ORIGIN_HANDLE_NEXT_BLOCK", llogd_body_only, llog_origin_handle_next_block_server); @@ -1640,10 +1618,6 @@ struct req_format RQF_LLOG_ORIGIN_HANDLE_READ_HEADER = llogd_body_only, llog_log_hdr_only); EXPORT_SYMBOL(RQF_LLOG_ORIGIN_HANDLE_READ_HEADER); -struct req_format RQF_LLOG_ORIGIN_CONNECT = - DEFINE_REQ_FMT0("LLOG_ORIGIN_CONNECT", llogd_conn_body_only, empty); -EXPORT_SYMBOL(RQF_LLOG_ORIGIN_CONNECT); - struct req_format RQF_CONNECT = DEFINE_REQ_FMT0("CONNECT", obd_connect_client, obd_connect_server); EXPORT_SYMBOL(RQF_CONNECT); diff --git a/lustre/ptlrpc/llog_client.c b/lustre/ptlrpc/llog_client.c index a39db55..0f149b6 100644 --- a/lustre/ptlrpc/llog_client.c +++ b/lustre/ptlrpc/llog_client.c @@ -136,41 +136,6 @@ out: return rc; } -static int llog_client_destroy(const struct lu_env *env, - struct llog_handle *loghandle, - struct thandle *th) -{ - struct obd_import *imp; - struct ptlrpc_request *req = NULL; - struct llogd_body *body; - int rc; - ENTRY; - - LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp); - req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_DESTROY, - LUSTRE_LOG_VERSION, - LLOG_ORIGIN_HANDLE_DESTROY); - if (req == NULL) - GOTO(err_exit, rc =-ENOMEM); - - body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY); - body->lgd_logid = loghandle->lgh_id; - body->lgd_llh_flags = loghandle->lgh_hdr->llh_flags; - - if (!(body->lgd_llh_flags & LLOG_F_IS_PLAIN)) - CERROR("%s: wrong llog flags %x\n", imp->imp_obd->obd_name, - body->lgd_llh_flags); - - ptlrpc_request_set_replen(req); - rc = ptlrpc_queue_wait(req); - - ptlrpc_req_finished(req); -err_exit: - LLOG_CLIENT_EXIT(loghandle->lgh_ctxt, imp); - RETURN(rc); -} - - static int llog_client_next_block(const struct lu_env *env, struct llog_handle *loghandle, int *cur_idx, int next_idx, @@ -368,7 +333,6 @@ struct llog_operations llog_client_ops = { .lop_prev_block = llog_client_prev_block, .lop_read_header = llog_client_read_header, .lop_open = llog_client_open, - .lop_destroy = llog_client_destroy, .lop_close = llog_client_close, }; EXPORT_SYMBOL(llog_client_ops); diff --git a/lustre/ptlrpc/llog_server.c b/lustre/ptlrpc/llog_server.c index 4864b49..ca91a1c 100644 --- a/lustre/ptlrpc/llog_server.c +++ b/lustre/ptlrpc/llog_server.c @@ -111,45 +111,6 @@ out_ctxt: return rc; } -int llog_origin_handle_destroy(struct ptlrpc_request *req) -{ - struct llogd_body *body; - struct llog_logid *logid = NULL; - struct llog_ctxt *ctxt; - int rc; - - ENTRY; - - body = req_capsule_client_get(&req->rq_pill, &RMF_LLOGD_BODY); - if (body == NULL) - RETURN(err_serious(-EFAULT)); - - rc = req_capsule_server_pack(&req->rq_pill); - if (rc < 0) - RETURN(err_serious(-ENOMEM)); - - if (ostid_id(&body->lgd_logid.lgl_oi) > 0) - logid = &body->lgd_logid; - - if (!(body->lgd_llh_flags & LLOG_F_IS_PLAIN)) - CERROR("%s: wrong llog flags %x\n", - req->rq_export->exp_obd->obd_name, body->lgd_llh_flags); - - if (body->lgd_ctxt_idx >= LLOG_MAX_CTXTS) { - CDEBUG(D_WARNING, "%s: bad ctxt ID: idx=%d\n", - req->rq_export->exp_obd->obd_name, body->lgd_ctxt_idx); - RETURN(-EPROTO); - } - - ctxt = llog_get_context(req->rq_export->exp_obd, body->lgd_ctxt_idx); - if (ctxt == NULL) - RETURN(-ENODEV); - - rc = llog_erase(req->rq_svc_thread->t_env, ctxt, logid, NULL); - llog_ctxt_put(ctxt); - RETURN(rc); -} - int llog_origin_handle_next_block(struct ptlrpc_request *req) { struct llog_handle *loghandle; @@ -324,15 +285,3 @@ out_ctxt: llog_ctxt_put(ctxt); return rc; } - -int llog_origin_handle_close(struct ptlrpc_request *req) -{ - int rc; - - ENTRY; - - rc = req_capsule_server_pack(&req->rq_pill); - if (rc) - RETURN(err_serious(-ENOMEM)); - RETURN(0); -} diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 3b8454d..79c4837 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1194,7 +1194,6 @@ out: struct tgt_handler tgt_obd_handlers[] = { TGT_OBD_HDL (0, OBD_PING, tgt_obd_ping), -TGT_OBD_HDL_VAR(0, OBD_LOG_CANCEL, tgt_obd_log_cancel), TGT_OBD_HDL (0, OBD_IDX_READ, tgt_obd_idx_read) }; EXPORT_SYMBOL(tgt_obd_handlers); @@ -1392,30 +1391,6 @@ int tgt_llog_open(struct tgt_session_info *tsi) } EXPORT_SYMBOL(tgt_llog_open); -int tgt_llog_close(struct tgt_session_info *tsi) -{ - int rc; - - ENTRY; - - rc = llog_origin_handle_close(tgt_ses_req(tsi)); - - RETURN(rc); -} -EXPORT_SYMBOL(tgt_llog_close); - - -int tgt_llog_destroy(struct tgt_session_info *tsi) -{ - int rc; - - ENTRY; - - rc = llog_origin_handle_destroy(tgt_ses_req(tsi)); - - RETURN(rc); -} - int tgt_llog_read_header(struct tgt_session_info *tsi) { int rc; @@ -1458,8 +1433,6 @@ TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_CREATE, tgt_llog_open), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_NEXT_BLOCK, tgt_llog_next_block), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_READ_HEADER, tgt_llog_read_header), TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_PREV_BLOCK, tgt_llog_prev_block), -TGT_LLOG_HDL (0, LLOG_ORIGIN_HANDLE_DESTROY, tgt_llog_destroy), -TGT_LLOG_HDL_VAR(0, LLOG_ORIGIN_HANDLE_CLOSE, tgt_llog_close), }; EXPORT_SYMBOL(tgt_llog_handlers);