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>
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>