Whamcloud - gitweb
LU-10994 clio: remove vvp_page_print() 98/47398/6
authorJohn L. Hammond <jhammond@whamcloud.com>
Thu, 19 May 2022 16:07:01 +0000 (11:07 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Sep 2022 02:55:12 +0000 (02:55 +0000)
Remove vvp_page_print() by placing equivalent code in cl_page_print().

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I815c4f63dc6fe57eec0987f209a2f34d3ff58146
Reviewed-on: https://review.whamcloud.com/47398
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/vvp_page.c
lustre/obdclass/cl_page.c

index be5caa3..f0edcbc 100644 (file)
@@ -225,29 +225,6 @@ static int vvp_page_make_ready(const struct lu_env *env,
        RETURN(result);
 }
 
-static int vvp_page_print(const struct lu_env *env,
-                         const struct cl_page_slice *slice,
-                         void *cookie, lu_printer_t printer)
-{
-       struct vvp_page *vpg    = cl2vvp_page(slice);
-       struct page     *vmpage = vpg->vpg_page;
-
-       (*printer)(env, cookie,
-                  LUSTRE_VVP_NAME"-page@%p vm@%p ", vpg, vmpage);
-
-       if (vmpage != NULL) {
-               (*printer)(env, cookie, "%lx %d:%d %lx %lu %slru",
-                          (long)vmpage->flags, page_count(vmpage),
-                          page_mapcount(vmpage), vmpage->private,
-                          page_index(vmpage),
-                          list_empty(&vmpage->lru) ? "not-" : "");
-       }
-
-       (*printer)(env, cookie, "\n");
-
-       return 0;
-}
-
 static int vvp_page_fail(const struct lu_env *env,
                         const struct cl_page_slice *slice)
 {
@@ -261,7 +238,6 @@ static int vvp_page_fail(const struct lu_env *env,
 
 static const struct cl_page_operations vvp_page_ops = {
        .cpo_discard       = vvp_page_discard,
-       .cpo_print         = vvp_page_print,
        .io = {
                [CRT_READ] = {
                        .cpo_prep       = vvp_page_prep_read,
@@ -277,7 +253,6 @@ static const struct cl_page_operations vvp_page_ops = {
 };
 
 static const struct cl_page_operations vvp_transient_page_ops = {
-       .cpo_print              = vvp_page_print,
 };
 
 int vvp_page_init(const struct lu_env *env, struct cl_object *obj,
index 5514840..68f61f3 100644 (file)
@@ -1149,21 +1149,36 @@ EXPORT_SYMBOL(cl_page_header_print);
  * Prints human readable representation of \a cl_page to the \a f.
  */
 void cl_page_print(const struct lu_env *env, void *cookie,
-                  lu_printer_t printer, const struct cl_page *cl_page)
+                  lu_printer_t printer, const struct cl_page *cp)
 {
+       struct page *vmpage = cp->cp_vmpage;
        const struct cl_page_slice *slice;
        int result = 0;
        int i;
 
-       cl_page_header_print(env, cookie, printer, cl_page);
-       cl_page_slice_for_each(cl_page, slice, i) {
+       cl_page_header_print(env, cookie, printer, cp);
+
+       (*printer)(env, cookie, "vmpage @%p", vmpage);
+
+       if (vmpage != NULL) {
+               (*printer)(env, cookie, " %lx %d:%d %lx %lu %slru",
+                          (long)vmpage->flags, page_count(vmpage),
+                          page_mapcount(vmpage), vmpage->private,
+                          page_index(vmpage),
+                          list_empty(&vmpage->lru) ? "not-" : "");
+       }
+
+       (*printer)(env, cookie, "\n");
+
+       cl_page_slice_for_each(cp, slice, i) {
                if (slice->cpl_ops->cpo_print != NULL)
                        result = (*slice->cpl_ops->cpo_print)(env, slice,
-                                                            cookie, printer);
+                                                             cookie, printer);
                if (result != 0)
                        break;
        }
-       (*printer)(env, cookie, "end page@%p\n", cl_page);
+
+       (*printer)(env, cookie, "end page@%p\n", cp);
 }
 EXPORT_SYMBOL(cl_page_print);