MDS: MDCache: Add internal_op_private void* to MDRequest; use it in scrub_dentry

This is a much better solution to our general problem than mashing the
validated_data into the Context that we were previously doing.
MDS: MDCache: provide a scrub_dentry() function that doesn't dump to a Formatter

We're going to use this internally, so expose the raw validated_data structure.

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CInode: add a const get_projected_inode() helper

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: inode_t: add scrub stamp and version for latest complete scrub

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CDir: rearrange constructor

Use colon initialization for all the members we can, instead of assignment
in the function body. The split is confusing and doesn't seem helpful.

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CInode: CDir: add scrub_[stamp|version] handling

TODO: Is resetting the scrub stamps on pop_projected_link() sufficient for
clearing it out on every rename?

Give each CInode a stamp and version for both the last started scrub, and
the last completed scrub. The last started scrubs are ephemeral, but we
add infrastructure to track when the "complete" values aren't flushed out
to disk.

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CInode: get new PIN_DIRTYSCRUBSTAMP when scrub info is dirty

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: CInode: extend scrub_info_t so it can store stamps from child CDirs

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CDir: Track dirty scrub stamps in a scrub_data_t struct

We'll use this to store data about in-progress scrubs, and allocate and
remove it on-demand. The first new member is a map_t of directories, which
we'll use to store the list of subdirs we need to scrub.

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: CDir: add more scrub metadata, and setup/handling functions

We don't want to force inodes-to-scrub to stay in the cache, so don't
use pointers to CDentry, just use dentry_key_t. And provide them for
non-dirs as well as dirs. And provide a list of those that we have
scrubbed in addition to those we haven't.

Implement setup_scrubbing() to initialize these structures, and a
mark_and_get_next_scrub_dentry() to move dentries between these lists and
get the next dentry to scrub.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: CDir: rename scrub_data -> scrub_info

Signed-off-by: Greg Farnum <greg@inktank.com>
mds:CDentry: add scrub_info_t and PIN_SCRUBQUEUE.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: CDentry: add an item_scrubqueue for use in ScrubStack

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: Create a new ScrubStack, which will be responsible for forward scrub

Signed-off-by: Greg Farnum <greg@inktank.com>
TEMP: allow NULL on_finish in Completion

Signed-off-by: Greg Farnum <greg@inktank.com>
FIXUP "mds: CDir: add more scrub metadata, and setup/handling functions"
SQUASH "MDS: CDir: rename scrub_data -> scrub_info"

Squash it down with "add more scrub metadata" and "Track dirty scrub stamps"
make ScrubStack compile
FIXUP "mds:CDentry: add scrub_info_t and PIN_SCRUBQUEUE."
SQUASH mds: CDir: split up mark_and_get_next_scrub_dentry

Instead, mark_dentry_scrubbed() and get_next_scrub_dentry(), plus all-new
child_scrubs_remaining().

Signed-off-by: Greg Farnum <greg@inktank.com>