xfs: make the key parameters to all btree key comparison functions const
The btree key comparison functions are not allowed to change the keys that are passed in, so mark them const. We'll need this for the next patch, which adds const to the btree range query functions. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -229,23 +229,23 @@ xfs_allocbt_init_ptr_from_cur(
|
||||
|
||||
STATIC int64_t
|
||||
xfs_bnobt_key_diff(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_key *key)
|
||||
struct xfs_btree_cur *cur,
|
||||
const union xfs_btree_key *key)
|
||||
{
|
||||
xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a;
|
||||
xfs_alloc_key_t *kp = &key->alloc;
|
||||
struct xfs_alloc_rec_incore *rec = &cur->bc_rec.a;
|
||||
const struct xfs_alloc_rec *kp = &key->alloc;
|
||||
|
||||
return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
|
||||
}
|
||||
|
||||
STATIC int64_t
|
||||
xfs_cntbt_key_diff(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_key *key)
|
||||
struct xfs_btree_cur *cur,
|
||||
const union xfs_btree_key *key)
|
||||
{
|
||||
xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a;
|
||||
xfs_alloc_key_t *kp = &key->alloc;
|
||||
int64_t diff;
|
||||
struct xfs_alloc_rec_incore *rec = &cur->bc_rec.a;
|
||||
const struct xfs_alloc_rec *kp = &key->alloc;
|
||||
int64_t diff;
|
||||
|
||||
diff = (int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
|
||||
if (diff)
|
||||
@@ -256,9 +256,9 @@ xfs_cntbt_key_diff(
|
||||
|
||||
STATIC int64_t
|
||||
xfs_bnobt_diff_two_keys(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_key *k1,
|
||||
union xfs_btree_key *k2)
|
||||
struct xfs_btree_cur *cur,
|
||||
const union xfs_btree_key *k1,
|
||||
const union xfs_btree_key *k2)
|
||||
{
|
||||
return (int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
|
||||
be32_to_cpu(k2->alloc.ar_startblock);
|
||||
@@ -266,11 +266,11 @@ xfs_bnobt_diff_two_keys(
|
||||
|
||||
STATIC int64_t
|
||||
xfs_cntbt_diff_two_keys(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_key *k1,
|
||||
union xfs_btree_key *k2)
|
||||
struct xfs_btree_cur *cur,
|
||||
const union xfs_btree_key *k1,
|
||||
const union xfs_btree_key *k2)
|
||||
{
|
||||
int64_t diff;
|
||||
int64_t diff;
|
||||
|
||||
diff = be32_to_cpu(k1->alloc.ar_blockcount) -
|
||||
be32_to_cpu(k2->alloc.ar_blockcount);
|
||||
|
||||
Reference in New Issue
Block a user