1 // SPDX-License-Identifier: GPL-2.0 1 // SPDX-License-Identifier: GPL-2.0 2 /* 2 /* 3 * Ceph 'frag' type 3 * Ceph 'frag' type 4 */ 4 */ 5 #include <linux/module.h> 5 #include <linux/module.h> 6 #include <linux/ceph/types.h> 6 #include <linux/ceph/types.h> 7 7 8 int ceph_frag_compare(__u32 a, __u32 b) 8 int ceph_frag_compare(__u32 a, __u32 b) 9 { 9 { 10 unsigned va = ceph_frag_value(a); 10 unsigned va = ceph_frag_value(a); 11 unsigned vb = ceph_frag_value(b); 11 unsigned vb = ceph_frag_value(b); 12 if (va < vb) 12 if (va < vb) 13 return -1; 13 return -1; 14 if (va > vb) 14 if (va > vb) 15 return 1; 15 return 1; 16 va = ceph_frag_bits(a); 16 va = ceph_frag_bits(a); 17 vb = ceph_frag_bits(b); 17 vb = ceph_frag_bits(b); 18 if (va < vb) 18 if (va < vb) 19 return -1; 19 return -1; 20 if (va > vb) 20 if (va > vb) 21 return 1; 21 return 1; 22 return 0; 22 return 0; 23 } 23 } 24 24
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.