Whamcloud - gitweb
LU-8066 obdclass: move lu_ref to debugfs 11/44311/6
authorJames Simmons <jsimmons@infradead.org>
Tue, 20 Jul 2021 20:14:09 +0000 (16:14 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 10 Aug 2021 08:07:53 +0000 (08:07 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/44311
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/cl_io.c
lustre/obdclass/lu_ref.c

index d3ce874..caf4701 100644 (file)
@@ -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
index ae79b43..bcc59fb 100644 (file)
@@ -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);
 }