Move all the lnet procfs variables to debugfs.
Linux-commit:
b03f395a3e9bf4874fb58f4fe6033866d3b9f105
This brings the OpenSFS branch into sync with upstream
lustre client. Technically debugfs is the not the proper
place for stats but due to the upstream client being
uses for production systems we have to keep them :-(
New work will be done in the future to properly handle
stats using sysfs instead.
Test-Parameters: trivial envdefinitions=ONLY=215 testlist=sanity
Change-Id: Id9244d8525f0844d321f29af4a01e1fbce8e5884
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/26430
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
extern int lnet_get_peer_list(__u32 *countp, __u32 *sizep,
lnet_process_id_t __user *ids);
-void lnet_proc_init(void);
-void lnet_proc_fini(void);
+void lnet_router_debugfs_init(void);
+void lnet_router_debugfs_fini(void);
int lnet_rtrpools_alloc(int im_a_router);
void lnet_destroy_rtrbuf(struct lnet_rtrbuf *rb, int npages);
int lnet_rtrpools_adjust(int tiny, int small, int large);
goto err_destroy_push_target;
lnet_fault_init();
- lnet_proc_init();
+ lnet_router_debugfs_init();
mutex_unlock(&the_lnet.ln_api_mutex);
lnet_fault_fini();
- lnet_proc_fini();
+ lnet_router_debugfs_init();
lnet_peer_discovery_stop();
lnet_push_target_fini();
lnet_router_checker_stop();
/* This is really lnet_proc.c. You might need to update sanity test 215
* if any file format is changed. */
-static struct ctl_table_header *lnet_table_header = NULL;
-
#define LNET_LOFFT_BITS (sizeof(loff_t) * 8)
/*
* NB: max allowed LNET_CPT_BITS is 8 on 64-bit system and 2 on 32-bit system
{ 0 }
};
-static struct ctl_table top_table[] = {
- {
- INIT_CTL_NAME
- .procname = "lnet",
- .mode = 0555,
- .data = NULL,
- .maxlen = 0,
- .child = lnet_table,
- },
- { 0 }
-};
-
-void
-lnet_proc_init(void)
+void lnet_router_debugfs_init(void)
{
-#ifdef CONFIG_SYSCTL
- if (lnet_table_header == NULL)
- lnet_table_header = register_sysctl_table(top_table);
-#endif
-}
-
-void
-lnet_proc_fini(void)
-{
-#ifdef CONFIG_SYSCTL
- if (lnet_table_header != NULL)
- unregister_sysctl_table(lnet_table_header);
-
- lnet_table_header = NULL;
-#endif
+ lnet_insert_debugfs(lnet_table, NULL);
}
# having "abc" as 1st arg, creates $TMP/lnet_abc.out and $TMP/lnet_abc.sys
create_lnet_proc_files() {
- lctl get_param -n $1 >$TMP/lnet_$1.out || error "cannot read lnet.$1"
- sysctl lnet.$1 >$TMP/lnet_$1.sys_tmp || error "cannot read lnet.$1"
-
- sed "s/^lnet.$1\ =\ //g" "$TMP/lnet_$1.sys_tmp" >$TMP/lnet_$1.sys
- rm -f "$TMP/lnet_$1.sys_tmp"
+ lctl get_param -n $1 >$TMP/lnet_$1.sys || error "cannot read lnet.$1"
}
# counterpart of create_lnet_proc_files
remove_lnet_proc_files() {
- rm -f $TMP/lnet_$1.out $TMP/lnet_$1.sys
+ rm -f $TMP/lnet_$1.sys
}
# uses 1st arg as trailing part of filename, 2nd arg as description for reports,
# can we successfully write to lnet.stats?
lctl set_param -n stats=0 || error "cannot write to lnet.stats"
- sysctl -w lnet.stats=0 || error "cannot write to lnet.stats"
}
run_test 215 "lnet exists and has proper content - bugs 18102, 21079, 21517"