blob: 6f67d5b884a0b8fc8efe7dde153d6bb918bddfbc [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Sage Weilde576062009-10-06 11:31:07 -07002/*
3 * Ceph 'frag' type
4 */
Yehuda Sadeh3d14c5d2010-04-06 15:14:15 -07005#include <linux/module.h>
6#include <linux/ceph/types.h>
Sage Weilde576062009-10-06 11:31:07 -07007
8int ceph_frag_compare(__u32 a, __u32 b)
9{
10 unsigned va = ceph_frag_value(a);
11 unsigned vb = ceph_frag_value(b);
12 if (va < vb)
13 return -1;
14 if (va > vb)
15 return 1;
16 va = ceph_frag_bits(a);
17 vb = ceph_frag_bits(b);
18 if (va < vb)
19 return -1;
20 if (va > vb)
21 return 1;
22 return 0;
23}