From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/common/ceph_frag.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/common/ceph_frag.cc (limited to 'src/common/ceph_frag.cc') diff --git a/src/common/ceph_frag.cc b/src/common/ceph_frag.cc new file mode 100644 index 000000000..444b910c2 --- /dev/null +++ b/src/common/ceph_frag.cc @@ -0,0 +1,21 @@ +/* + * Ceph 'frag' type + */ +#include "include/types.h" + +int ceph_frag_compare(__u32 a, __u32 b) +{ + unsigned va = ceph_frag_value(a); + unsigned vb = ceph_frag_value(b); + if (va < vb) + return -1; + if (va > vb) + return 1; + va = ceph_frag_bits(a); + vb = ceph_frag_bits(b); + if (va < vb) + return -1; + if (va > vb) + return 1; + return 0; +} -- cgit v1.2.3