]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: make the start pointer passed to btree alloc_block 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: deb06b9ab6dfa167c280a68d5acb2f12e007073f

The @start pointer passed to each per-AG btree type's ->alloc_block
function isn't supposed to be modified, since it's a hint about the
location of the btree block being split that is to be fed to the
allocator, so mark the parameter 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_bmap_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 c10f20d6c9cfa021b59f73a81562d586b0c56e01..33b43c7c44351884fba6dcef95be3625a03fbdb4 100644 (file)
@@ -48,10 +48,10 @@ xfs_allocbt_set_root(
 
 STATIC int
 xfs_allocbt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        int                     error;
        xfs_agblock_t           bno;
index 9e2e9926a19d908b10285a284bbc65ad85e1b8ab..0552157a6c75a2665d32eb075cc7593708e23c47 100644 (file)
@@ -191,10 +191,10 @@ xfs_bmbt_update_cursor(
 
 STATIC int
 xfs_bmbt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        xfs_alloc_arg_t         args;           /* block allocation args */
        int                     error;          /* error return value */
index 504032d91a0a37d80b75bc7ac2098351b2cbeaeb..8a36012a2e89b4ebe92842e7b84c3a4d745cca1d 100644 (file)
@@ -110,7 +110,7 @@ struct xfs_btree_ops {
 
        /* block allocation / freeing */
        int     (*alloc_block)(struct xfs_btree_cur *cur,
-                              union xfs_btree_ptr *start_bno,
+                              const union xfs_btree_ptr *start_bno,
                               union xfs_btree_ptr *new_bno,
                               int *stat);
        int     (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp);
index d808f0fcffb60920efb808baebd09c3d48154695..146d2475e68c0d8574dd1d2f4009388d51673ef9 100644 (file)
@@ -59,10 +59,10 @@ xfs_btree_fakeroot_dup_cursor(
  */
 STATIC int
 xfs_btree_fakeroot_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start_bno,
-       union xfs_btree_ptr     *new_bno,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start_bno,
+       union xfs_btree_ptr             *new_bno,
+       int                             *stat)
 {
        ASSERT(0);
        return -EFSCORRUPTED;
index f644882b1a58a7009706d9cfee9fd81299b0162f..5053c4a51e4538fc38de4e1417e371cce956b95f 100644 (file)
@@ -87,11 +87,11 @@ xfs_inobt_mod_blockcount(
 
 STATIC int
 __xfs_inobt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat,
-       enum xfs_ag_resv_type   resv)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat,
+       enum xfs_ag_resv_type           resv)
 {
        xfs_alloc_arg_t         args;           /* block allocation args */
        int                     error;          /* error return value */
@@ -126,20 +126,20 @@ __xfs_inobt_alloc_block(
 
 STATIC int
 xfs_inobt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        return __xfs_inobt_alloc_block(cur, start, new, stat, XFS_AG_RESV_NONE);
 }
 
 STATIC int
 xfs_finobt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        if (cur->bc_mp->m_finobt_nores)
                return xfs_inobt_alloc_block(cur, start, new, stat);
index 291098a923b426f26ad0d7970c73ef8914d39ae5..7a5a1a8da467ed370b1e953258cd2c1443e2ce9d 100644 (file)
@@ -50,10 +50,10 @@ xfs_refcountbt_set_root(
 
 STATIC int
 xfs_refcountbt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agf          *agf = agbp->b_addr;
index 755246c672da95c862cb9b9e3e5e7e68fb3b656a..7a441f641977deb80e67b5855ab333c6df9019e8 100644 (file)
@@ -74,10 +74,10 @@ xfs_rmapbt_set_root(
 
 STATIC int
 xfs_rmapbt_alloc_block(
-       struct xfs_btree_cur    *cur,
-       union xfs_btree_ptr     *start,
-       union xfs_btree_ptr     *new,
-       int                     *stat)
+       struct xfs_btree_cur            *cur,
+       const union xfs_btree_ptr       *start,
+       union xfs_btree_ptr             *new,
+       int                             *stat)
 {
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agf          *agf = agbp->b_addr;