There are several easy cleanups that can be done in the mgc config code and its interfaces.
As noted on https://review.whamcloud.com/#/c/27320/:
The definition of struct config_llog_data can be moved to mgc_request.c. Same for cld_is_*() and the declaration of mgc_process_log().
The declarations mgc_fsname2resid() and mgc_logname2resid() can be moved to mgc_internal.h and neither function needs to be exported.
mgc_process_log() can be made static.
The data and datalen parameters of obd_process_config() should be replaces with a struct lustre_cfg * parameter:
Most of the char *logname or char *fsname parameters in lustre/mgc/ should be converted to const char *.
Similarly, most of the struct config_llog_instance * parameters should be const qualified.
The void *cfg_instance member of struct config_llog_instance should be const qualified.
The ordering of parameters is inconsistent:
Several functions can be simplified if we use a const void *instance parameter (pointing to the sb or obd device) rather than a struct config_llog_instance * parameter. These include config_log_find() and config_log_end().
After this is done, the lustre_cfg for LCFG_LOG_END can be simplified to pass just the sb or obd pointer instead of a whole struct config_llog_instance.
We should also consider removing LCFG_LOG_START and LCFG_LOG_END and replacing their uses with calls to new obd methods. There's no reason to pack in kernel objects into a lustre_cfg for this and it obscures analysis of these functions.