osd: add pg_pool_t::get_pg_num_divisor

A PG is not always an equally sized fraction of the total pool size due to
the use of ceph_stable_mod.  Add a helper to return the fraction
(denominator) of a given pg based on the current pg_num value.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: rename test/test_osd_types.cc -> test/osd/types.cc

Signed-off-by: Sage Weil <sage@inktank.com>
mon: include dirty stats in 'ceph df detail'

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: add on_finish to OpContext

Add a callback hook for whenever an OpContext completes or cancels.  We
are pretty sloppy here about the return values because our initial user
will not care, and it is unclear if future users will.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: make target dirty ratio 40%

That's half of the full target (80%).

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: factor clone check out of evict op code

Move the check for clones into a helper so that we will be able to use in
other places where we need to evict.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: agent worker thread

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: basic flush and evict agent functionality

This is very basic flush and evict functionality for the tiering agent.

The flush policy is very simple: if we are above the threshold and the
object is dirty, and not super young, flush it.  This is not too braindead
of a policy (although we could clearly do something smarter).

The evict policy is pretty braindead: evict the object if it is clean and
we are over our full threshold.  This needs to be augmented to estimate
age based on the HitSets.

Signed-off-by: Sage Weil <sage@inktank.com>
wip handle scrub vs flush race