mds: fix calls to Objecter::wait_for_map

These were wrong in the earlier commit:
"mds: use lock-safe OSDMap accessors; adjust Objecter wait_for_map call"

Rather than checking epoch explicitly and dropping the lock before
calling wait_for_map, just make a single call to wait_for_map and handle
the return code to learn whether we are waiting or not.

Signed-off-by: John Spray <john.spray@redhat.com>
osdc: locking for Journaler

also remove the lock pointers that JournalPointer load/save
used to require in order to use the objecter.

Signed-off-by: John Spray <john.spray@redhat.com>
osdc: Use a finisher from Journaler

There is a choice here between having all contexts passed into
journaler be safe to call from inside the journaler lock (i.e.
caller does the C_OnFinisher wrapping), or to allow any contexts
(i.e. we wrap in a C_OnFinisher).  In this version I choose the
latter, so that callers can pass whatever they like through.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: update mds_lock handling in Locker contexts

For some contexts, we expect to be called back from the objecter/filer
on an I/O completion, so we must take mds_lock before updating any
MDS metadata.  In others, we expect to be called back from the MDCache
in response to updates to a CInode's state, so we assert that mds_lock
is already held.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: fix Server::C_MarkEvent locking

... it should acquire mds_lock.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: fix C_MDC_TruncateFinish locking

This one needed to take mds_lock, and be invoked
from a finisher.

Signed-off-by: John Spray <john.spray@redhat.com>
mds/MDLog: del stale ref to C_MDS_WroteImportMap

(class no longer exists)

Signed-off-by: John Spray <john.spray@redhat.com>
mds/MDLog: enable Journaler finisher

Signed-off-by: John Spray <john.spray@redhat.com>
osdc/Objecter: make homeless_session a pointer

Have a non-pointer member that's a RefCountedObject
was awkward, e.g. tripping nref==0 assertion during
destruction.  Rather than play games with refcount
during destruction, just make it a new/delete instance
instead.

Signed-off-by: John Spray <john.spray@redhat.com>