client: remove unused C_SnapFlush

Signed-off-by: John Spray <john.spray@redhat.com>
client: add missing lock in sync_write_commit

This would otherwise assert when entering
the objectcacher.

Also add assertions for all the other Contexts
in Client, which are currently correct but not
so obvious.

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

Squash into "osdc: locking for Journaler"

Signed-off-by: John Spray
osdc/Journaler: move finisher wraps to filer calls

Do these for all Filer operations, not just
for waitfor_safe completions: this is to avoid
lock cycles between Journaler lock and the underlying
Objecter's osd session lock.

Squash into "osdc: locking for Journaler"

Signed-off-by: John Spray <john.spray@redhat.com>
[rough cut] mds: add MDSContext subclasses

Divide all contexts into MDSInternalContext (things to
be called back inside mds_lock), and MDSIOContext (entry
points to the MDS from e.g. the objecter, which should
themselves take mds_lock when they are called).

Three nice things about this:
 * Static enforcement, where references such as CacheObject
   waiters expect a certain type of context, they can now
   declare it to be so using one of the new types.
 * Runtime enforcement, MDSInternalContext now asserts
   that the lock is indeed held when a context is called back.
 * Readability

Still TODO:
 * Get per-subsystem subclasses of MDSInternalContext that
   use their existing Server/MDCache/Locker whatever reference
   instead of bloating the structure with an extra MDS*
 * Maybe make Finisher a template that can accept only
   a particular type of context (perhaps the MDS finisher
   should only accept MDSIOContexts?)
 * Convert the IO contexts over to MDSIOContext (mostly
   they are currently still Context)

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