summaryrefslogtreecommitdiff
path: root/net/ceph/osdmap.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-06-19 12:18:05 +0200
committerIlya Dryomov <idryomov@gmail.com>2017-07-07 17:25:17 +0200
commita02a946dfe9633d7e0202359836f6b5217a62824 (patch)
tree005dc13eca08a7dc99ffa9a465ab7f5fc7402ee2 /net/ceph/osdmap.c
parent76f827a7b1faaaebc53f89d184e95ea3a0b8dd71 (diff)
downloadlinux-riscv-a02a946dfe9633d7e0202359836f6b5217a62824.tar.gz
linux-riscv-a02a946dfe9633d7e0202359836f6b5217a62824.tar.bz2
linux-riscv-a02a946dfe9633d7e0202359836f6b5217a62824.zip
libceph: respect RADOS_BACKOFF backoffs
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/osdmap.c')
-rw-r--r--net/ceph/osdmap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 1e2e190a4c2a..1d87a736221b 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -418,6 +418,22 @@ int ceph_pg_compare(const struct ceph_pg *lhs, const struct ceph_pg *rhs)
return 0;
}
+int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs)
+{
+ int ret;
+
+ ret = ceph_pg_compare(&lhs->pgid, &rhs->pgid);
+ if (ret)
+ return ret;
+
+ if (lhs->shard < rhs->shard)
+ return -1;
+ if (lhs->shard > rhs->shard)
+ return 1;
+
+ return 0;
+}
+
/*
* rbtree of pg_mapping for handling pg_temp (explicit mapping of pgid
* to a set of osds) and primary_temp (explicit primary setting)