- loff_t pos;
- struct ll_sb_info *sbi;
- struct cl_object *clob;
- struct lu_env *env;
- struct vvp_pgcache_id id;
- int refcheck;
- int result;
-
- env = cl_env_get(&refcheck);
- if (!IS_ERR(env)) {
- pos = *(loff_t *) v;
- vvp_pgcache_id_unpack(pos, &id);
- sbi = f->private;
- clob = vvp_pgcache_obj(env, &sbi->ll_cl->cd_lu_dev, &id);
- if (clob != NULL) {
- struct inode *inode = vvp_object_inode(clob);
- struct cl_page *page = NULL;
- struct page *vmpage;
-
- result = find_get_pages_contig(inode->i_mapping,
- id.vpi_index, 1, &vmpage);
- if (result > 0) {
- lock_page(vmpage);
- page = cl_vmpage_page(vmpage, clob);
- unlock_page(vmpage);
-
- page_cache_release(vmpage);
- }
-
- seq_printf(f, "%8x@"DFID": ", id.vpi_index,
- PFID(lu_object_fid(&clob->co_lu)));
- if (page != NULL) {
- vvp_pgcache_page_show(env, f, page);
- cl_page_put(env, page);
- } else
- seq_puts(f, "missing\n");
- lu_object_ref_del(&clob->co_lu, "dump", current);
- cl_object_put(env, clob);
- } else
- seq_printf(f, "%llx missing\n", pos);
- cl_env_put(env, &refcheck);
- result = 0;
- } else
- result = PTR_ERR(env);
- return result;
+ struct vvp_seq_private *priv = f->private;
+ struct page *vmpage = v;
+ struct cl_page *page;
+
+ seq_printf(f, "%8lx@" DFID ": ", vmpage->index,
+ PFID(lu_object_fid(&priv->vsp_clob->co_lu)));
+ lock_page(vmpage);
+ page = cl_vmpage_page(vmpage, priv->vsp_clob);
+ unlock_page(vmpage);
+ put_page(vmpage);
+
+ if (page) {
+ vvp_pgcache_page_show(priv->vsp_env, f, page);
+ cl_page_put(priv->vsp_env, page);
+ } else {
+ seq_puts(f, "missing\n");
+ }
+
+ return 0;