Commit 60e265f7 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: make the start pointer passed to btree update_lastrec functions const

This btree function is called when updating a record in the rightmost
block of a btree so that we can update the AGF's longest free extent
length field.  Neither parameter is supposed to be updated, so mark them
both const.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent deb06b9a
...@@ -103,11 +103,11 @@ xfs_allocbt_free_block( ...@@ -103,11 +103,11 @@ xfs_allocbt_free_block(
*/ */
STATIC void STATIC void
xfs_allocbt_update_lastrec( xfs_allocbt_update_lastrec(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
struct xfs_btree_block *block, const struct xfs_btree_block *block,
union xfs_btree_rec *rec, const union xfs_btree_rec *rec,
int ptr, int ptr,
int reason) int reason)
{ {
struct xfs_agf *agf = cur->bc_ag.agbp->b_addr; struct xfs_agf *agf = cur->bc_ag.agbp->b_addr;
struct xfs_perag *pag; struct xfs_perag *pag;
......
...@@ -117,8 +117,8 @@ struct xfs_btree_ops { ...@@ -117,8 +117,8 @@ struct xfs_btree_ops {
/* update last record information */ /* update last record information */
void (*update_lastrec)(struct xfs_btree_cur *cur, void (*update_lastrec)(struct xfs_btree_cur *cur,
struct xfs_btree_block *block, const struct xfs_btree_block *block,
union xfs_btree_rec *rec, const union xfs_btree_rec *rec,
int ptr, int reason); int ptr, int reason);
/* records in block/level */ /* records in block/level */
...@@ -423,7 +423,7 @@ void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); ...@@ -423,7 +423,7 @@ void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
/* /*
* Helpers. * Helpers.
*/ */
static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block) static inline int xfs_btree_get_numrecs(const struct xfs_btree_block *block)
{ {
return be16_to_cpu(block->bb_numrecs); return be16_to_cpu(block->bb_numrecs);
} }
...@@ -434,7 +434,7 @@ static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block, ...@@ -434,7 +434,7 @@ static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
block->bb_numrecs = cpu_to_be16(numrecs); block->bb_numrecs = cpu_to_be16(numrecs);
} }
static inline int xfs_btree_get_level(struct xfs_btree_block *block) static inline int xfs_btree_get_level(const struct xfs_btree_block *block)
{ {
return be16_to_cpu(block->bb_level); return be16_to_cpu(block->bb_level);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment