include/memory: add static_pointer_cast

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: MDRequest: rename to MDRequestImpl, and declare MDRequestRef

We're switching the MDRequest to be used as a shared pointer. This is the
first step on the path to inserting an OpTracker into the MDS.
Give the MDRequestImpl a weak_ptr self_ref so that we can keep
using the elist for now.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: Convert the request_start* functions and their immediate callers

Also, the active_requests mapping gets weak pointers.

Signed-off-by: Greg Farnum <greg@inktank.com>
Server: Use MDRequestRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: use MDRequestRef instead of MDRequest*

Signed-off-by: Greg Farnum <greg@inktank.com>
Locker: use MDRequestRef instead of MDRequest*

Signed-off-by: Greg Farnum <greg@inktank.com>
Mutation: rename to MutationImpl and define MutationRef

Signed-off-by: Greg Farnum <greg@inktank.com>
Mutation: move self_ref into MutationImpl instead of MDRequestImpl

We keep an MDRequestImpl::set_self_ref(MDRequestRef&) function so
that we don't need to do the pointer conversion elsewhere.

Signed-off-by: Greg Farnum <greg@inktank.com>
SimpleLock: use MutationRef instead of raw pointers

While we're here, remove the non-const get_xlock_by() (because
we don't need it). Also note we return a full MutationRef
(instead of a ref to the stored one). It's necessary in case we
don't have a set-up more() object.

Signed-off-by: Greg Farnum <greg@inktank.com>
Migrator: use MDRequestRef and MutationRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
Migrator: use a null ref instead of NULL when calling into path_traverse

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: switch cache object classes to use MutationRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
Server: use MutationRef instead of raw pointer

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: use MutationRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: use a null_ref instead of NULL in a few places

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: fix users of active_requests for use of shared_ptr

Signed-off-by: Greg Farnum <greg@inktank.com>
Locker: Use MutationRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
Locker: use a null_ref instead of NULL

Signed-off-by: Greg Farnum <greg@inktank.com>
Locker: Switch some MutationRef& for MutationRef

Sadly, you can't implicitly convert non-const references to shared pointers. :(

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: use MutationRef instead of MutationRef& in some places

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