mon: Monitor: MMonGetMap doesn't require caps

We are dropping the requirement for MON_CAP_R for MMonGetMap.

Reason is simple enough: clients may need to contact the monitors and
obtain the latest monmap before authenticating.  This happens, for
instance, when a client calls MonClient::get_monmap_privately().  The
osd uses this function during mkfs, prior to initializing a keyring or
even so much as existing.

Fixes: #9859

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
Merge pull request #2777 from ceph/wip-9859

mon: Monitor: MMonGetMap doesn't require caps

Reviewed-by: Sage Weil <sage@redhat.com>
shared_cache::add: do not delete value if existed

The method contract specifies that we do not want to delete
value if we are not inserting it, so do not initialize val
at the top of the function to take over value.  No current
users appear to trip over this problem (FDCache and
map_cache).

Signed-off-by: Samuel Just <sam.just@inktank.com>
shared_cache: add purge and tests

purge detaches the lru shared_ptr currently associated from
the key from the lru even if there are still references.

Signed-off-by: Samuel Just <sam.just@inktank.com>
FDCache: purge hoid on clear

We no longer require that a lock on the FD be held for the duration of an
operation, only while accessing the actual index.  We cannot, therefore, assume
that a racing read during lfn_unlink (backfill or scrub) does not still have a
reference to the fd.  We want to remove the fd from the cache to prevent
subsequent operations from finding it while allowing such a racing read to
complete with its existing fd.

Fixes: #9480
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge remote-tracking branches 'origin/wip-9821', 'dachary/wip-9408-buffer-alignment-giant' and 'origin/wip-9480' into wip-sam-testing