ceph: simplify ceph_fh_to_dentry()

MDS handles LOOKUPHASH and LOOKUPINO MDS requests in the same way.
So __cfh_to_dentry() is redundant.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ceph: fix ceph_fh_to_parent()

ceph_fh_to_parent() finds the inode that corresponds to the 'ino' field
of struct ceph_nfs_confh. This is wrong, it should find the inode that
corresponds to the 'parent_ino' field.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ceph: add get_parent() NFS export callback

The callback uses LOOKUPPARENT MDS request to find parent.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ceph: add get_name() NFS export callback

Set WANT_DENTRY flag for the LOOKUPINO MDS request. The flag makes
MDS reply contain dentry trace.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ceph: print inode number for LOOKUPINO request

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
vfs: Make __d_materialise_dentry() set the materialised dentry name correctly

Make __d_materialise_dentry() set the materialised dentry name correctly by
flipping the arguments to switch_names().

switch_names() is lazy: if both names are internal to their dentries, it'll
overwrite that of the first dentry with that of the second, and won't update
that of the second.

In the case of __d_materialise_dentry(), the second is an already extant
anonymous dentry that we want to insert into the tree in place of the dentry we
just looked up[*].  However, the dentry we just looked up carries the name we
actually want to use.

[*] This is used by NFS to join a mount of a subtree into a mount of a tree
nearer the root when the two meet, where both mounts share a superblock and
thus a set of dentries.

Signed-off-by: David Howells <dhowells@redhat.com>