osd: move pow2_hist_t out of osd_types and into include/

This has only been used for the OSD so far, but as with the rest
of the OpRequest stuff, it's actually pretty generic.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpRequest: remove obsolete comment about ref-counting (use OpRequestRef!)

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: start making the OpTracker into a generic

We're starting by templating the create_request function and having
the OpTracker work in terms of TrackedOp[Ref]s intead of
OpRequest[Ref]s. This involves moving a bunch of stuff into the
base-class TrackedOp.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: add an init_from_message() to the TrackedOp interface

This can be used for the concrete implementations to gather any
extra data out of the message and do whatever extra setup based
on that they want. The OpTracker will call this after doing all its
internal setup but before anybody else gets to see the TrackedOp.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: move the OpTracker and OpHistory into common/TrackedOp.[h|cc]

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: remove the references to "osd" in config variables

We may want to have daemon-specific settings in the future, but that
will be a small interface change and in the mean time this keeps a clear
demarcation between OSD and OpTracker infrastructure.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: move OpTracker pointer and some init code into TrackedOp

Clean up some member privacy issues while we're working on them.

Signed-off-by: Greg Farnum <greg@inktank.com>
osd: change how we work around an interface limitation.

If this had ever actually been triggered we would have hit an assert
in the OpRequest destructor that op->request is non-NULL.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: include a destructor for the TrackedOp base class.

Our method of handling the OpRequest destructor is a little weird,
but we're about to get rid of the request member finagling.

Signed-off-by: Greg Farnum <greg@inktank.com>
osd: use TrackedOp::get_req() instead of direct access to the request.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: provide a default implementation of TrackedOp::state_string

We're moving towards dynamically-allocated states instead of the static
ones this started with, so the whole bitmask-based thing doesn't make
much sense any more. Assume people won't use that and provide a default.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: demand that a TrackedOp gets to own its Message for life.

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: get rid of TrackedOp::received_time for the Message

Signed-off-by: Greg Farnum <greg@inktank.com>
OpTracker: give TrackedOp a default dump() function

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: template OpTracker on only T[::Ref] (ie, OpRequest[::Ref])

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: just make CephContext member public

This is the only reason we were making OpRequest a friend class, which
is just a bad idea.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: rework dump interface a little

Put only the bare essentials in the TrackedOp::dump() implementation, but
have that call into a _dump() function that implementations can specify.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: give people an _event_marked() notifier instead of a virtual mark_event()

This is less prone to getting broken.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: specify queue sizes and warnings on a per-tracker basis

If we have multiple trackers in a daemon, we want to be able to configure
them separately. Plus, users already know how to control op sizes in the
OSD, so changing the config options (as we did in a8bbb81b7b7b6420ea08bc4e99a39adc6c3c397a)
is not really appropriate. Instead, provider setters which can be called
at construction time (or on any other change) and use them in the OSD with
the configurables we had previously. Add an observer so you can continue
to change them at run-time

This reverts a8bbb81b7b7b6420ea08bc4e99a39adc6c3c397a

Signed-off-by: Greg Farnum <greg@inktank.com>
Merge branch 'master' into wip-optracker

Conflicts:
	src/osd/OpRequest.h
	src/osd/PG.cc
	src/osd/ReplicatedPG.cc

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