From 6b319185659104bd65a837fe2b3cbe550d83c650 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 20 Jul 2021 16:14:09 -0400 Subject: [PATCH] LU-8066 obdclass: move lu_ref to debugfs A special procfs file is created for lu_ref debugging. Lets move this to debugfs where it belongs. Also fixed a missed USE_LU_REF due to landing order as well as a build fix. Fixes: dfe2d225b86 ("LU-13799 clio: Implement real list splice") Change-Id: I33646a87adfcabc5a5f214832953b2444e7aaf0a Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/44311 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Andreas Dilger Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- lustre/obdclass/cl_io.c | 5 ++--- lustre/obdclass/lu_ref.c | 22 +++++++--------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index d3ce874..caf4701 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -922,13 +922,12 @@ EXPORT_SYMBOL(cl_page_list_move_head); */ void cl_page_list_splice(struct cl_page_list *src, struct cl_page_list *dst) { -#ifdef USE_LU_REF +#ifdef CONFIG_LUSTRE_DEBUG_LU_REF struct cl_page *page; struct cl_page *tmp; - ENTRY; - cl_page_list_for_each_safe(page, tmp, list) + cl_page_list_for_each_safe(page, tmp, src) lu_ref_set_at(&page->cp_reference, &page->cp_queue_ref, "queue", src, dst); #else diff --git a/lustre/obdclass/lu_ref.c b/lustre/obdclass/lu_ref.c index ae79b43..bcc59fb 100644 --- a/lustre/obdclass/lu_ref.c +++ b/lustre/obdclass/lu_ref.c @@ -285,8 +285,6 @@ void lu_ref_del_at(struct lu_ref *ref, struct lu_ref_link *link, } EXPORT_SYMBOL(lu_ref_del_at); -#ifdef CONFIG_PROC_FS - static void *lu_ref_seq_start(struct seq_file *seq, loff_t *pos) { struct lu_ref *ref = seq->private; @@ -411,8 +409,6 @@ static const struct file_operations lu_ref_dump_fops = { .release = lu_ref_seq_release }; -#endif /* CONFIG_PROC_FS */ - int lu_ref_global_init(void) { int result; @@ -421,24 +417,20 @@ int lu_ref_global_init(void) "lu_ref tracking is enabled. Performance isn't.\n"); result = lu_kmem_init(lu_ref_caches); + if (result) + return result; -#ifdef CONFIG_PROC_FS - if (result == 0) { - result = lprocfs_seq_create(proc_lustre_root, "lu_refs", - 0444, &lu_ref_dump_fops, NULL); - if (result) - lu_kmem_fini(lu_ref_caches); - } -#endif /* CONFIG_PROC_FS */ + debugfs_create_file("lu_refs", 0444, debugfs_lustre_root, + NULL, &lu_ref_dump_fops); return result; } void lu_ref_global_fini(void) { -#ifdef CONFIG_PROC_FS - lprocfs_remove_proc_entry("lu_refs", proc_lustre_root); -#endif /* CONFIG_PROC_FS */ + /* debugfs file gets cleaned up by debugfs_remove_recursive on + * debugfs_lustre_root + */ lu_kmem_fini(lu_ref_caches); } -- 1.8.3.1