- if (id.vpi_bucket >= CFS_HASH_NHLIST(site->ls_obj_hash))
- return NULL;
- clob = vvp_pgcache_obj(env, dev, &id);
- if (clob) {
- struct inode *inode = vvp_object_inode(clob);
- struct page *vmpage;
- int nr;
-
- nr = find_get_pages_contig(inode->i_mapping,
- id.vpi_index, 1, &vmpage);
- if (nr > 0) {
- id.vpi_index = vmpage->index;
- /* Cant support over 16T file */
- if (vmpage->index <= 0xffffffff) {
- *clobp = clob;
- *pos = vvp_pgcache_id_pack(&id);
- return vmpage;
- }
- put_page(vmpage);
- }
-
- lu_object_ref_del(&clob->co_lu, "dump", current);
- cl_object_put(env, clob);
+ struct inode *inode;
+ struct page *vmpage;
+ int nr;
+
+ if (!priv->vsp_clob) {
+ struct cl_object *clob;
+
+ while ((clob = vvp_pgcache_obj(priv->vsp_env, dev, &priv->vvp_id)) == NULL &&
+ ++(priv->vvp_id.vpi_bucket) < CFS_HASH_NHLIST(dev->ld_site->ls_obj_hash))
+ priv->vvp_id.vpi_depth = 0;
+ if (!clob)
+ return NULL;
+ priv->vsp_clob = clob;
+ priv->vvp_id.vpi_index = 0;
+ }
+
+ inode = vvp_object_inode(priv->vsp_clob);
+ nr = find_get_pages_contig(inode->i_mapping, priv->vvp_id.vpi_index, 1, &vmpage);
+ if (nr > 0) {
+ priv->vvp_id.vpi_index = vmpage->index;
+ return vmpage;