]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: make the key parameters to all btree query range functions const
authorDarrick J. Wong <djwong@kernel.org>
Mon, 31 Jan 2022 20:25:47 +0000 (15:25 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jan 2022 20:25:47 +0000 (15:25 -0500)
Source kernel commit: 04dcb47482a9d9e27feba48ca92613edced42ef9

Range query functions are not supposed to modify the query keys that are
being passed in, so mark them all 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.c
libxfs/xfs_alloc.h
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_rmap.c
libxfs/xfs_rmap.h

index 5f4553427d0852c6e97fb2589d351104093ca52a..105c90b0352c2ace7acc850ab7c4631e77f84784 100644 (file)
@@ -3403,8 +3403,8 @@ xfs_alloc_query_range_helper(
 int
 xfs_alloc_query_range(
        struct xfs_btree_cur                    *cur,
-       struct xfs_alloc_rec_incore             *low_rec,
-       struct xfs_alloc_rec_incore             *high_rec,
+       const struct xfs_alloc_rec_incore       *low_rec,
+       const struct xfs_alloc_rec_incore       *high_rec,
        xfs_alloc_query_range_fn                fn,
        void                                    *priv)
 {
index e30900b6f8ba4b53d0ae49f7464f7a6be2845b06..3554b7d420f0b16adda39d10706877214db25cbd 100644 (file)
@@ -225,8 +225,8 @@ typedef int (*xfs_alloc_query_range_fn)(
        void                            *priv);
 
 int xfs_alloc_query_range(struct xfs_btree_cur *cur,
-               struct xfs_alloc_rec_incore *low_rec,
-               struct xfs_alloc_rec_incore *high_rec,
+               const struct xfs_alloc_rec_incore *low_rec,
+               const struct xfs_alloc_rec_incore *high_rec,
                xfs_alloc_query_range_fn fn, void *priv);
 int xfs_alloc_query_all(struct xfs_btree_cur *cur, xfs_alloc_query_range_fn fn,
                void *priv);
index 8455f26a73259ad36949f430fbbef490f5c4ce55..aedc62a5a7b0b12d43a4234453073e98638334d2 100644 (file)
@@ -4537,8 +4537,8 @@ xfs_btree_compute_maxlevels(
 STATIC int
 xfs_btree_simple_query_range(
        struct xfs_btree_cur            *cur,
-       union xfs_btree_key             *low_key,
-       union xfs_btree_key             *high_key,
+       const union xfs_btree_key       *low_key,
+       const union xfs_btree_key       *high_key,
        xfs_btree_query_range_fn        fn,
        void                            *priv)
 {
@@ -4628,8 +4628,8 @@ out:
 STATIC int
 xfs_btree_overlapped_query_range(
        struct xfs_btree_cur            *cur,
-       union xfs_btree_key             *low_key,
-       union xfs_btree_key             *high_key,
+       const union xfs_btree_key       *low_key,
+       const union xfs_btree_key       *high_key,
        xfs_btree_query_range_fn        fn,
        void                            *priv)
 {
@@ -4770,8 +4770,8 @@ out:
 int
 xfs_btree_query_range(
        struct xfs_btree_cur            *cur,
-       union xfs_btree_irec            *low_rec,
-       union xfs_btree_irec            *high_rec,
+       const union xfs_btree_irec      *low_rec,
+       const union xfs_btree_irec      *high_rec,
        xfs_btree_query_range_fn        fn,
        void                            *priv)
 {
index 7154ad8647c919aceffe63870d6888e47b1dd266..462c25857a2647bd5bdf3eefb76290c4e5814d07 100644 (file)
@@ -474,7 +474,8 @@ typedef int (*xfs_btree_query_range_fn)(struct xfs_btree_cur *cur,
                union xfs_btree_rec *rec, void *priv);
 
 int xfs_btree_query_range(struct xfs_btree_cur *cur,
-               union xfs_btree_irec *low_rec, union xfs_btree_irec *high_rec,
+               const union xfs_btree_irec *low_rec,
+               const union xfs_btree_irec *high_rec,
                xfs_btree_query_range_fn fn, void *priv);
 int xfs_btree_query_all(struct xfs_btree_cur *cur, xfs_btree_query_range_fn fn,
                void *priv);
index b95421efbcb064cc431951911582c683dde51b95..100e904d9cd5f9a072c6fccecddbd811fd0f2e79 100644 (file)
@@ -2295,8 +2295,8 @@ xfs_rmap_query_range_helper(
 int
 xfs_rmap_query_range(
        struct xfs_btree_cur                    *cur,
-       struct xfs_rmap_irec                    *low_rec,
-       struct xfs_rmap_irec                    *high_rec,
+       const struct xfs_rmap_irec              *low_rec,
+       const struct xfs_rmap_irec              *high_rec,
        xfs_rmap_query_range_fn                 fn,
        void                                    *priv)
 {
index f2423cf7f1e28d63d920b50d33f2722a3643e815..1354efc4ddabea422d567509f41b36c38c3f915c 100644 (file)
@@ -139,7 +139,8 @@ typedef int (*xfs_rmap_query_range_fn)(
        void                    *priv);
 
 int xfs_rmap_query_range(struct xfs_btree_cur *cur,
-               struct xfs_rmap_irec *low_rec, struct xfs_rmap_irec *high_rec,
+               const struct xfs_rmap_irec *low_rec,
+               const struct xfs_rmap_irec *high_rec,
                xfs_rmap_query_range_fn fn, void *priv);
 int xfs_rmap_query_all(struct xfs_btree_cur *cur, xfs_rmap_query_range_fn fn,
                void *priv);