DBObjectMap, hobject: add helpers for pgid bit matching

Create helpers in hobject for generating prefixes for a
pg as well as matching hobjects against a pgid/numpgs
combo.  Use these in HashIndex.cc.

Signed-off-by: Samuel Just <sam.just@inktank.com>
common/shared_ptr.hpp: add get_next and expose VPtr and WeakVPtr types

Signed-off-by: Samuel Just <sam.just@inktank.com>
common/: add map_cacher

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: add SnapMapper

Signed-off-by: Samuel Just <sam.just@inktank.com>
test/: add tests for map_cacher

Signed-off-by: Samuel Just <sam.just@inktank.com>
Makefile: add SnapMapper to osd

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: Integrate SnapMapper with OSD

- SnapTrimmer now uses SnapMapper to get the next object to trim
- Entries for a snap are implicitely removed from SnapMapper when
the last object is trimmed, so no need for the adjust_local_snaps
logic.
- Scrub now compares the object_info snaps set on the object attr
with the version stored in the SnapMapper.

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: lock not needed in ~DeletingState()

No further refs to the object can remain at this point.
Furthermore, the callbacks might lock mutexes of their
own.

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: update purged_snaps in merge_log

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD,PG: add upgrade procedure for snap_mapper

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: check and repair snap_mapper entries during scrub

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: remove snap_mapper entries in RemoveWQ

This is a somewhat ugly hack for now until we implement
pg resurrection.

Signed-off-by: Samuel Just <sam.just@inktank.com>
HashIndex: _collection_list_partial must tolerate NULL next

Signed-off-by: Samuel Just <sam.just@inktank.com>
FileStore: collection_empty fix return value, was reversed

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG::read_log: fix assert, split may introduce holes in the log

Signed-off-by: Samuel Just <sam.just@inktank.com>