MRP-1700 mdt: child-parent lock ordering in rename

change rename so that it always has parent-child lock ordering,
otherwise it may deadlock with other operations.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: If676da82ca50a20a4bb3aadef0f81c9c5ed3cbcb
Reviewed-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
MRP-1700 obd: lu_object_find_at hung

lu_object_find_at hungs if called 2 times and object is removed
in between. It makes mdt_rename_sanity not workable for rename.
Change mdt_rename_sanity to work on existing object.

the following commit is included:
    LU-5069 mds: check if the object exist before subdir check

also, make it posix compliant, an attempt to make a dir a subdir
of itself must return EINVAL

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: I10dc08de30ae5cd4faaa84eb0d5841ad13267a23
MRP-1921 mdt: rename vs link deadlock

it may happen that tgt child for rename is a directory, which is used
as tgt dir for link in parallel, as the result rename locks src child,
tgt child what may deadlock with tgt dir, src file locking of link.

As non-dir cannot replace dir, check it before locking the tgt child.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: I74ac27926e1e3ecfaa90a95109fa614d40413ece