Add header cache to DBObjectMap

OMap is used by PG to store PGLog, so it's called by each write operations.
Because leveldb don't play well in random read and "header_lock" limit the
concurrence. Add a LRU cache to avoid too much overload on seeking header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
common: WRITE_{EQ,CMP}_OPERATORS_1

For when a struct is defined to encapsulate a single value and get
control over implicit conversions that would otherwise be impossible
with typedef.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: factorize shard_id_t/shard_t into a struct

The struct contains a single uint8_t and is preferred to control
conversions that would otherwise be implicit. There is no difference
between shard_id_t and shard_t. The definition is moved in
include/types.h so it is available to both hobject.h and osd_types.h

http://tracker.ceph.com/issues/8254 Fixes: #8254

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: loop over uint8_t instead of shard_id_t

When looping in the range [0,number of shards[ using a uint8_t variable
which is an integer instead of shard_id_t. The alternative would be
define the ++ operator on shard_id_t but since the two are used
interchangeably in a number of places, that seems unnecessary.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: explicit shard_id_t() and NO_SHARD

Whenever an integer needs to be converted in a shard_id_t,
replace the implicit conversion with an explicit call to the
constructor.

Replace all ghobject_t::NO_SHARD and ghobject_t::no_shard() with
shard_id_t::NO_SHARD

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: replace shard_t usage with shard_id_t

Signed-off-by: Loic Dachary <loic@dachary.org>
libs3: update to latest git master of ceph/libs3

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Revert "Remove unused variables in KeyValueStore.cc"

This reverts commit 23b657c704865b33aa2e0e39995712c1f583c24d.

The get_* methods have side-effects!
Revert "Remove unused variables in MemStore.cc"

This reverts commit 307ba481a2705338560ecb557741d459706bdeb6.

The get_* methods have side effects!

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1917 from ceph/wip-da-update-libs3

libs3: update to latest git master of ceph/libs3

Reviewed-by: Loic Dachary <loic@dachary.org>
Merge pull request #1865 from dachary/wip-8254

osd: convert shard_id_t  from uint8_t to struct + merge shard_t into it

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1582 from yuyuyu101/omap-cache

Add header cache to DBObjectMap

Reveiewed-by: Samuel Just <sam.just@inktank.com>
debug
OSD::calc_priors_during: fix confusing for loop bracing (cosmetic)

Confusing lack of braces is confusing.

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD::calc_priors_during: handle CRUSH_ITEM_NONE correctly

Fixes: #8507
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge remote-tracking branches 'origin/wip-7999', 'origin/wip-8396', 'origin/wip-8438', 'upstream/next' and 'origin/wip-8507' into wip-sam-testing