]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: make the pointer passed to btree set_root functions const
authorDarrick J. Wong <djwong@kernel.org>
Mon, 31 Jan 2022 20:25:48 +0000 (15:25 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jan 2022 20:25:48 +0000 (15:25 -0500)
Source kernel commit: b5a6e5fe0e6840bc90e51cf522d6c5a880cde567

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>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc_btree.c
libxfs/xfs_btree.h
libxfs/xfs_btree_staging.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount_btree.c
libxfs/xfs_rmap_btree.c

index 79130125506815a975ed045ed40c614262b4a6a2..c10f20d6c9cfa021b59f73a81562d586b0c56e01 100644 (file)
@@ -29,9 +29,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 ace2eb7c33fb2c61f681960a3c3c656e252c0c2b..d808f0fcffb60920efb808baebd09c3d48154695 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 14b54f1342495d68546c0fb0c079c3278ab9a675..f644882b1a58a7009706d9cfee9fd81299b0162f 100644 (file)
@@ -39,9 +39,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;
@@ -53,9 +53,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 b088c4a0a313cbf941a2ace28213513f67320697..291098a923b426f26ad0d7970c73ef8914d39ae5 100644 (file)
@@ -30,9 +30,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 6d28a4690a0f306d7772ebf1204bda58d7a76dd3..755246c672da95c862cb9b9e3e5e7e68fb3b656a 100644 (file)
@@ -55,9 +55,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;