xfs: make the pointer passed to btree set_root functions const
authorDarrick J. Wong <djwong@kernel.org>
Thu, 12 Aug 2021 16:49:03 +0000 (09:49 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 19 Aug 2021 01:46:02 +0000 (18:46 -0700)
The pointer passed to each per-AG btree type's ->set_root function isn't
supposed to be modified (that function sets an external pointer to the
root block) so mark them const.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_btree_staging.c
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_refcount_btree.c
fs/xfs/libxfs/xfs_rmap_btree.c

index c2d2a0be56d80d26ead7bef4fb6a584a83c7a734..87f7f9f27449048674763ed43ede2a27bb1e2b7a 100644 (file)
@@ -31,9 +31,9 @@ xfs_allocbt_dup_cursor(
 
 STATIC void
 xfs_allocbt_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *ptr,
-       int                     inc)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *ptr,
+       int                             inc)
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agf          *agf = agbp->b_addr;
index 4b95373c6d236155a0caf31a6f493b9fcb99d7a4..504032d91a0a37d80b75bc7ac2098351b2cbeaeb 100644 (file)
@@ -106,7 +106,7 @@ struct xfs_btree_ops {
 
        /* update btree root pointer */
        void    (*set_root)(struct xfs_btree_cur *cur,
-                           union xfs_btree_ptr *nptr, int level_change);
+                           const union xfs_btree_ptr *nptr, int level_change);
 
        /* block allocation / freeing */
        int     (*alloc_block)(struct xfs_btree_cur *cur,
index aa8dc9521c39424fa95c810cd4ac502b39aad1cc..bce6a3da98655cb646d5d379600c2d4611519366 100644 (file)
@@ -112,9 +112,9 @@ xfs_btree_fakeroot_init_ptr_from_cur(
 /* Update the btree root information for a per-AG fake root. */
 STATIC void
 xfs_btree_afakeroot_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *ptr,
-       int                     inc)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *ptr,
+       int                             inc)
 {
        struct xbtree_afakeroot *afake = cur->bc_ag.afake;
 
index a6ba08bb9bfe4ad50edf306e073fe1e52569f8eb..903537a08c8ee85d3372e578b1b4dbeb9390da3e 100644 (file)
@@ -40,9 +40,9 @@ xfs_inobt_dup_cursor(
 
 STATIC void
 xfs_inobt_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *nptr,
-       int                     inc)    /* level change */
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *nptr,
+       int                             inc)    /* level change */
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agi          *agi = agbp->b_addr;
@@ -54,9 +54,9 @@ xfs_inobt_set_root(
 
 STATIC void
 xfs_finobt_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *nptr,
-       int                     inc)    /* level change */
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *nptr,
+       int                             inc)    /* level change */
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agi          *agi = agbp->b_addr;
index 907869014a99c5b68a991f5a18172721d0d13baa..ec4b7195c371175e239b4675a5f2a4c5ae87fcb2 100644 (file)
@@ -31,9 +31,9 @@ xfs_refcountbt_dup_cursor(
 
 STATIC void
 xfs_refcountbt_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *ptr,
-       int                     inc)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *ptr,
+       int                             inc)
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agf          *agf = agbp->b_addr;
index 3c3cf4971bd7fdee3ebd2a843a8894754f9f224d..4b62064d0baab6d3dc7a0f85e5f46293d96a9b40 100644 (file)
@@ -57,9 +57,9 @@ xfs_rmapbt_dup_cursor(
 
 STATIC void
 xfs_rmapbt_set_root(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *ptr,
-       int                     inc)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *ptr,
+       int                             inc)
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agf          *agf = agbp->b_addr;