mds: journal EImportFinish after adjusting subtree auth

Submitting EImportFinish may journal an extra ESubtreeMap as side
effect. The ESubtreeMap should reflects subtree state after import
is finished.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: include all of directory inode's replicas in rmdir witnesses

If a MDS crashed after journaling a rmdir operation, but before sending
MDentryUnlink messages. Survivor MDS may have incorrect linkage for the
removed directory. Later when the MDS recovers, the incorrect linkage
can cause survivor MDS crash.

The fix is include all of directory inode's replicas in rmdir witnesses
list. When receiving a rmdir slave request, MDS who has no auth subtree
in the directory only need to update its cache and send reply (doesn't
need to journal the slave request).

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: skip journaling slave rename when possible

Rename operation can affect three dentries and two inodes. For MDS
who receives rename slave request, but isn't authority of any of
these dentries/inodes and doesn't have any auth subtree under these
dentries/inodes, journaling slave rename can be skipped.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: allow early reply when there is no journaled slave update

Early reply should be Ok when there were slave requests, but none
of them modifies any object.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: journal rename source inode when rollback rename

rename changes the source inode's ctime. rollback changes ctime back
to its original value.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: try trimming exported objects

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: drop locks after removing import/export state

dropping locks can dispatch requests, which may export the same
dirfrag again.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: fix remote auth pin race

When removing auth unpinned objects from mdr->remote_auth_pins,
Server::handle_slave_auth_pin() checks object's authority to decide
if the object was auth pinned by a given MDS. This method isn't
reliable because when object isn't auth pinned, its authority may
change.

The fix is remember from which MDS an objects was auth pinned.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: queue waiters in MDCache::force_dir_fragment()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Merge pull request #1793 from ceph/wip-multimds

Speed up several cross-MDS operations by reducing the number of two-phase commit disk accesses we have to go through.

Reviewed-by: Greg Farnum <greg@inktank.com>