From 3dc94d835dc3adf871c3603fc91c08bdd36701ff Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 22 Sep 2015 11:24:15 -0400 Subject: [PATCH] LU-5969 lustreapi: remove obsolete lctl dump_cfg code With Lustre having utilites that can read lustre record logs from user space we no longer need the ability to dump the log of recorded commands to the kernel dump log. Signed-off-by: Andreas Dilger Change-Id: I8b3b71ff394a1f81e4b2396449e0f6879c2b5623 Reviewed-on: http://review.whamcloud.com/15857 Reviewed-by: frank zago Reviewed-by: John L. Hammond Tested-by: Jenkins Reviewed-by: Mike Pershin Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/lustre_ioctl.h | 2 +- lustre/include/obd_class.h | 4 +--- lustre/mgs/mgs_handler.c | 11 ----------- lustre/obdclass/obd_config.c | 27 --------------------------- lustre/utils/lctl.c | 3 --- lustre/utils/obd.c | 29 ----------------------------- lustre/utils/obdctl.h | 1 - 7 files changed, 2 insertions(+), 75 deletions(-) diff --git a/lustre/include/lustre_ioctl.h b/lustre/include/lustre_ioctl.h index a7670f3..8ead377 100644 --- a/lustre/include/lustre_ioctl.h +++ b/lustre/include/lustre_ioctl.h @@ -369,7 +369,7 @@ obd_ioctl_unpack(struct obd_ioctl_data *data, char *pbuf, int max_len) /* OBD_IOC_PARSE _IOWR('f', 182, OBD_IOC_DATA_TYPE) */ /* OBD_IOC_DORECORD _IOWR('f', 183, OBD_IOC_DATA_TYPE) */ #define OBD_IOC_PROCESS_CFG _IOWR('f', 184, OBD_IOC_DATA_TYPE) -#define OBD_IOC_DUMP_LOG _IOWR('f', 185, OBD_IOC_DATA_TYPE) +/* OBD_IOC_DUMP_LOG _IOWR('f', 185, OBD_IOC_DATA_TYPE) */ /* OBD_IOC_CLEAR_LOG _IOWR('f', 186, OBD_IOC_DATA_TYPE) */ #define OBD_IOC_PARAM _IOW ('f', 187, OBD_IOC_DATA_TYPE) #define OBD_IOC_POOL _IOWR('f', 188, OBD_IOC_DATA_TYPE) diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 7a37ba2..8f01ef5 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -171,7 +171,7 @@ struct config_llog_instance { char *cfg_obdname; void *cfg_instance; struct super_block *cfg_sb; - struct obd_uuid cfg_uuid; + struct obd_uuid cfg_uuid; llog_cb_t cfg_callback; int cfg_last_idx; /* for partial llog processing */ int cfg_flags; @@ -179,8 +179,6 @@ struct config_llog_instance { }; int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt, char *name, struct config_llog_instance *cfg); -int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt, - char *name, struct config_llog_instance *cfg); enum { CONFIG_T_CONFIG = 0, diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 8c2c8ea..ff23c33 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -935,17 +935,6 @@ out_free: rc = mgs_iocontrol_nodemap(&env, mgs, data); break; - case OBD_IOC_DUMP_LOG: { - struct llog_ctxt *ctxt; - - ctxt = llog_get_context(mgs->mgs_obd, LLOG_CONFIG_ORIG_CTXT); - rc = class_config_dump_llog(&env, ctxt, data->ioc_inlbuf1, - NULL); - llog_ctxt_put(ctxt); - - break; - } - case OBD_IOC_CATLOGLIST: rc = mgs_list_logs(&env, mgs, data); break; diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 0b6ff29..222038c 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1900,33 +1900,6 @@ int class_config_dump_handler(const struct lu_env *env, RETURN(rc); } -int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt, - char *name, struct config_llog_instance *cfg) -{ - struct llog_handle *llh; - int rc; - - ENTRY; - - LCONSOLE_INFO("Dumping config log %s\n", name); - - rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS); - if (rc) - RETURN(rc); - - rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL); - if (rc) - GOTO(parse_out, rc); - - rc = llog_process(env, llh, class_config_dump_handler, cfg, NULL); -parse_out: - llog_close(env, llh); - - LCONSOLE_INFO("End config log %s\n", name); - RETURN(rc); -} -EXPORT_SYMBOL(class_config_dump_llog); - /** Call class_cleanup and class_detach. * "Manual" only in the sense that we're faking lcfg commands. */ diff --git a/lustre/utils/lctl.c b/lustre/utils/lctl.c index 88c5fe8..23f7f58 100644 --- a/lustre/utils/lctl.c +++ b/lustre/utils/lctl.c @@ -310,9 +310,6 @@ command_t cmdlist[] = { "usage: setup "}, {"cleanup", jt_obd_cleanup, 0, "cleanup previously setup device\n" "usage: cleanup [force | failover]"}, - {"dump_cfg", jt_cfg_dump_log, 0, - "print log of recorded commands for this config to kernel debug log\n" - "usage: dump_cfg config-uuid-name"}, /* Test only commands */ {"==== testing (DANGEROUS) ====", jt_noop, 0, "testing (DANGEROUS)"}, diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index bb19f34..06414a4 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -2409,35 +2409,6 @@ int jt_obd_mdc_lookup(int argc, char **argv) return rc; } -int jt_cfg_dump_log(int argc, char **argv) -{ - struct obd_ioctl_data data; - char rawbuf[MAX_IOC_BUFLEN], *buf = rawbuf; - int rc; - - if (argc != 2) - return CMD_HELP; - - memset(&data, 0, sizeof(data)); - data.ioc_dev = cur_device; - data.ioc_inllen1 = strlen(argv[1]) + 1; - data.ioc_inlbuf1 = argv[1]; - - memset(buf, 0, sizeof(rawbuf)); - rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf)); - if (rc) { - fprintf(stderr, "error: %s: invalid ioctl\n", - jt_cmdname(argv[0])); - return rc; - } - rc = l_ioctl(OBD_DEV_ID, OBD_IOC_DUMP_LOG, buf); - if (rc < 0) - fprintf(stderr, "OBD_IOC_DUMP_LOG failed: %s\n", - strerror(errno)); - - return rc; -} - int jt_llog_catlist(int argc, char **argv) { struct obd_ioctl_data data; diff --git a/lustre/utils/obdctl.h b/lustre/utils/obdctl.h index 95c3c59..0e8103f 100644 --- a/lustre/utils/obdctl.h +++ b/lustre/utils/obdctl.h @@ -82,7 +82,6 @@ int jt_obd_deactivate(int argc, char **argv); int jt_obd_recover(int argc, char **argv); int jt_obd_mdc_lookup(int argc, char **argv); int jt_get_version(int argc, char **argv); -int jt_cfg_dump_log(int argc, char **argv); int jt_get_obj_version(int argc, char **argv); int jt_llog_catlist(int argc, char **argv); -- 1.8.3.1