swh:1:snp:3c665ee4f67729f27f2e40193ab88e7298cf0fef
Raw File
Tip revision: 0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b authored by Linus Torvalds on 21 March 2021, 21:56:43 UTC
Linux 5.12-rc4
Tip revision: 0d02ec6
ceph_frag.c
// SPDX-License-Identifier: GPL-2.0
/*
 * Ceph 'frag' type
 */
#include <linux/module.h>
#include <linux/ceph/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;
}
back to top