Commit 82b63ee1 authored by Fedor Pchelkin's avatar Fedor Pchelkin Committed by Carlos Maiolino
Browse files

xfs: rename key_diff routines



key_diff routines compare a key value with a cursor value. Make the naming
to be a bit more self-descriptive.

Found by Linux Verification Center (linuxtesting.org).

Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent edce1724
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ xfs_allocbt_init_ptr_from_cur(
}

STATIC int64_t
xfs_bnobt_key_diff(
xfs_bnobt_cmp_key_with_cur(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*key)
{
@@ -198,7 +198,7 @@ xfs_bnobt_key_diff(
}

STATIC int64_t
xfs_cntbt_key_diff(
xfs_cntbt_cmp_key_with_cur(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*key)
{
@@ -438,7 +438,7 @@ const struct xfs_btree_ops xfs_bnobt_ops = {
	.init_high_key_from_rec	= xfs_bnobt_init_high_key_from_rec,
	.init_rec_from_cur	= xfs_allocbt_init_rec_from_cur,
	.init_ptr_from_cur	= xfs_allocbt_init_ptr_from_cur,
	.key_diff		= xfs_bnobt_key_diff,
	.cmp_key_with_cur	= xfs_bnobt_cmp_key_with_cur,
	.buf_ops		= &xfs_bnobt_buf_ops,
	.cmp_two_keys		= xfs_bnobt_cmp_two_keys,
	.keys_inorder		= xfs_bnobt_keys_inorder,
@@ -468,7 +468,7 @@ const struct xfs_btree_ops xfs_cntbt_ops = {
	.init_high_key_from_rec	= xfs_cntbt_init_high_key_from_rec,
	.init_rec_from_cur	= xfs_allocbt_init_rec_from_cur,
	.init_ptr_from_cur	= xfs_allocbt_init_ptr_from_cur,
	.key_diff		= xfs_cntbt_key_diff,
	.cmp_key_with_cur	= xfs_cntbt_cmp_key_with_cur,
	.buf_ops		= &xfs_cntbt_buf_ops,
	.cmp_two_keys		= xfs_cntbt_cmp_two_keys,
	.keys_inorder		= xfs_cntbt_keys_inorder,
+2 −2
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ xfs_bmbt_init_rec_from_cur(
}

STATIC int64_t
xfs_bmbt_key_diff(
xfs_bmbt_cmp_key_with_cur(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*key)
{
@@ -647,7 +647,7 @@ const struct xfs_btree_ops xfs_bmbt_ops = {
	.init_key_from_rec	= xfs_bmbt_init_key_from_rec,
	.init_high_key_from_rec	= xfs_bmbt_init_high_key_from_rec,
	.init_rec_from_cur	= xfs_bmbt_init_rec_from_cur,
	.key_diff		= xfs_bmbt_key_diff,
	.cmp_key_with_cur	= xfs_bmbt_cmp_key_with_cur,
	.cmp_two_keys		= xfs_bmbt_cmp_two_keys,
	.buf_ops		= &xfs_bmbt_buf_ops,
	.keys_inorder		= xfs_bmbt_keys_inorder,
+1 −1
Original line number Diff line number Diff line
@@ -2070,7 +2070,7 @@ xfs_btree_lookup(
				 *  - greater than, move left
				 *  - equal, we're done
				 */
				diff = cur->bc_ops->key_diff(cur, kp);
				diff = cur->bc_ops->cmp_key_with_cur(cur, kp);
				if (diff < 0)
					low = keyno + 1;
				else if (diff > 0)
+6 −3
Original line number Diff line number Diff line
@@ -171,8 +171,11 @@ struct xfs_btree_ops {
	void	(*init_high_key_from_rec)(union xfs_btree_key *key,
					  const union xfs_btree_rec *rec);

	/* difference between key value and cursor value */
	int64_t (*key_diff)(struct xfs_btree_cur *cur,
	/*
	 * Compare key value and cursor value -- positive if key > cur,
	 * negative if key < cur, and zero if equal.
	 */
	int64_t (*cmp_key_with_cur)(struct xfs_btree_cur *cur,
				    const union xfs_btree_key *key);

	/*
+3 −3
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ xfs_finobt_init_ptr_from_cur(
}

STATIC int64_t
xfs_inobt_key_diff(
xfs_inobt_cmp_key_with_cur(
	struct xfs_btree_cur		*cur,
	const union xfs_btree_key	*key)
{
@@ -430,7 +430,7 @@ const struct xfs_btree_ops xfs_inobt_ops = {
	.init_high_key_from_rec	= xfs_inobt_init_high_key_from_rec,
	.init_rec_from_cur	= xfs_inobt_init_rec_from_cur,
	.init_ptr_from_cur	= xfs_inobt_init_ptr_from_cur,
	.key_diff		= xfs_inobt_key_diff,
	.cmp_key_with_cur	= xfs_inobt_cmp_key_with_cur,
	.buf_ops		= &xfs_inobt_buf_ops,
	.cmp_two_keys		= xfs_inobt_cmp_two_keys,
	.keys_inorder		= xfs_inobt_keys_inorder,
@@ -460,7 +460,7 @@ const struct xfs_btree_ops xfs_finobt_ops = {
	.init_high_key_from_rec	= xfs_inobt_init_high_key_from_rec,
	.init_rec_from_cur	= xfs_inobt_init_rec_from_cur,
	.init_ptr_from_cur	= xfs_finobt_init_ptr_from_cur,
	.key_diff		= xfs_inobt_key_diff,
	.cmp_key_with_cur	= xfs_inobt_cmp_key_with_cur,
	.buf_ops		= &xfs_finobt_buf_ops,
	.cmp_two_keys		= xfs_inobt_cmp_two_keys,
	.keys_inorder		= xfs_inobt_keys_inorder,
Loading