osdmap: implement subtree_is_down() and containing_subtree_is_down()

Implement two methos to see if an entire subtree is down, and if the
containing parent node of type T of a given node is completely down.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: set limit so that we do not an entire down subtree out

Add new configurable 'mon osd down out subtree limit' so that you can
prevent marking out an entire subtree.  If for example an entire rack is
down, do not mark anything in it out.  If less than the whole rack is down,
everything is fair game.

Set the default to 'rack'.

Signed-off-by: Sage Weil <sage@inktank.com>
crush: a leaf is not a child of itself

Signed-off-by: Sage Weil <sage@inktank.com>
osdmap: use stack-local down_cache if caller didn't provide one

That way this method at least will avoid redoing work.

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

The bottom bit of this loop is the same as subtree_is_down(), assuming
we have a down_cache for the *p == current bit.  That's simpler.

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