summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/types.cc4
-rw-r--r--src/include/types.h6
-rw-r--r--src/osd/ECBackend.cc2
-rw-r--r--src/osd/PG.h4
-rw-r--r--src/osd/PGBackend.cc2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/common/types.cc b/src/common/types.cc
index 1ad2ccc7daf..36861329242 100644
--- a/src/common/types.cc
+++ b/src/common/types.cc
@@ -22,11 +22,11 @@
#define UINT8_MAX (255)
#endif
-const shard_id_t shard_id_t::NO_SHARD(UINT8_MAX);
+const shard_id_t shard_id_t::NO_SHARD(-1);
ostream &operator<<(ostream &lhs, const shard_id_t &rhs)
{
- return lhs << (unsigned)rhs.id;
+ return lhs << (unsigned)(uint8_t)rhs.id;
}
#endif
diff --git a/src/include/types.h b/src/include/types.h
index a36eac5b578..ddb0e9aed72 100644
--- a/src/include/types.h
+++ b/src/include/types.h
@@ -470,12 +470,12 @@ inline ostream& operator<<(ostream& out, const weightf_t& w)
}
struct shard_id_t {
- uint8_t id;
+ int8_t id;
shard_id_t() : id(0) {}
- explicit shard_id_t(uint8_t _id) : id(_id) {}
+ explicit shard_id_t(int8_t _id) : id(_id) {}
- operator uint8_t() const { return id; }
+ operator int8_t() const { return id; }
const static shard_id_t NO_SHARD;
diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc
index d5e37120174..07d0708ed45 100644
--- a/src/osd/ECBackend.cc
+++ b/src/osd/ECBackend.cc
@@ -841,7 +841,7 @@ void ECBackend::handle_sub_write(
localt);
if (!(dynamic_cast<ReplicatedPG *>(get_parent())->is_undersized()) &&
- get_parent()->whoami_shard().shard >= ec_impl->get_data_chunk_count())
+ (unsigned)get_parent()->whoami_shard().shard >= ec_impl->get_data_chunk_count())
op.t.set_fadvise_flag(CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
if (on_local_applied_sync) {
diff --git a/src/osd/PG.h b/src/osd/PG.h
index e5e437757a4..1394b4f761c 100644
--- a/src/osd/PG.h
+++ b/src/osd/PG.h
@@ -784,14 +784,14 @@ public:
}
bool is_acting(pg_shard_t osd) const {
if (pool.info.ec_pool()) {
- return acting.size() > osd.shard && acting[osd.shard] == osd.osd;
+ return acting.size() > (unsigned)osd.shard && acting[osd.shard] == osd.osd;
} else {
return std::find(acting.begin(), acting.end(), osd.osd) != acting.end();
}
}
bool is_up(pg_shard_t osd) const {
if (pool.info.ec_pool()) {
- return up.size() > osd.shard && up[osd.shard] == osd.osd;
+ return up.size() > (unsigned)osd.shard && up[osd.shard] == osd.osd;
} else {
return std::find(up.begin(), up.end(), osd.osd) != up.end();
}
diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc
index 319110cd0dd..64423dee1f3 100644
--- a/src/osd/PGBackend.cc
+++ b/src/osd/PGBackend.cc
@@ -109,7 +109,7 @@ int PGBackend::objects_list_partial(
// make sure the result list has the marker object (
// it might have multiple generations though, which would
// be filtered).
- ghobject_t _next(begin, 0, shard_id_t(0));
+ ghobject_t _next(begin, 0, shard_id_t::NO_SHARD);
ls->reserve(max);
int r = 0;
while (!_next.is_max() && ls->size() < (unsigned)min) {