Whamcloud - gitweb
LU-8066 llite: change how "dump_page_cache" walks a hash table 11/33011/3
authorNeilBrown <neilb@suse.com>
Mon, 17 Sep 2018 17:44:56 +0000 (13:44 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 7 Oct 2018 00:56:36 +0000 (00:56 +0000)
commitec2e9995e4c5c14e4169ba69edd7e1b6cd6e834f
tree0fa786c6c5d1ff73bab44591bbdd9cbc8fa27325
parent5fc0ac8c83e9766a05a8440d5cca70084b5d23f6
LU-8066 llite: change how "dump_page_cache" walks a hash table

The "dump_page_cache" seq_file currently tries to encode
a location in the hash table into a 64bit file index so that
the seq_file can seek to any location.

This is not necessary with the current implementation of seq_file.
seq_file performs any seeks needed itself by rewinding and calling
->next and ->show until the required index is reached.

The required behaviour of ->next is that it always returns the next
object after the last one returned by either ->start or ->next.
It can ignore the ppos, but should increment it.

The required behaviour of ->start is one of:
1/ if *ppos is 0, then return the first object
2/ if *ppos is the same value that was passed to the most recent call
   to either ->start or ->next, then return the same object again
3/ if *ppos is anything else, return the next object after the most
   recently returned one.

To implement this we store a vvp_pgcache_id (index into hash table)
in the seq_private data structure, and also store 'prev_pos' as the
last value passed to either ->start or ->next.

We remove all converstion of an id to a pos, and any limits on the
size of the vpi_depth.

vvp_pgcache_obj_get() is changed to ignore dying objects so that
vvp_pgcache_obj only returns NULL when it reaches the end of a hash
chain, and so vpi_bucket needs to be incremented.

A reference to the current ->clob pointer is now kept as long as we
are iterating over the pages in a given object, so we don't have to
try to find it again (and possibly fail) for each page.

And the ->start and ->next functions are changed as described above.

Test-Parameters: trivial envdefinitions="ONLY=63b" testlist=sanity
Test-Parameters: trivial envdefinitions="ONLY=118" testlist=sanity
Test-Parameters: trivial envdefinitions="ONLY=20" testlist=sanityn

Change-Id: I2c6d2be47f809cb4a944aa3de6f561ce4f08bbf4
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33011
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/vvp_dev.c