client: skip insert_trace on safe requests

Only do this for the first reply.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: refactor _lookup; fix NULL dentry case

Return ENOENT for a valid NULL dentry in our cache.  Restructure _lookup
to avoid duplicating some code.

Signed-off-by: Sage Weil <sage@inktank.com>
client: do not manually clean up on unlink/rmdir

The reply handler will do this in a safe, ordered fashion.

Signed-off-by: Sage Weil <sage@inktank.com>
client: unlink dentry on traceless rmdir, unlink reply

This used to be handled in _unlink() and _rmdir() even when a trace was
present in the reply, but this is cleaner.

Signed-off-by: Sage Weil <sage@inktank.com>
client: audit unlink() callers

Basically, always keep the dentry and dir, unless we are pruning.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: invalidate dentry leases when unlinking

In many case when we are unlinking inodes we also need to invalidate the
dentry lease, as we are not promised that the dentry is NULL.  Be a bit
over-conservative here for good measure.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: make less noise when unlinking during readdir

Skip, but do not talk about, NULL dentries.

Signed-off-by: Sage Weil <sage@inktank.com>
client: use __func__ instead of incorrect function name in insert_readdir_results

Signed-off-by: Sage Weil <sage@inktank.com>
client: fix whitespace in stat relpath

Signed-off-by: Sage Weil <sage@inktank.com>