]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h
authorDarrick J. Wong <djwong@kernel.org>
Mon, 16 Oct 2023 16:21:47 +0000 (09:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 17 Oct 2023 23:24:22 +0000 (16:24 -0700)
Move all the declarations for functionality in xfs_rtbitmap.c into a
separate xfs_rtbitmap.h header file.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_rtbitmap.c
fs/xfs/libxfs/xfs_rtbitmap.h [new file with mode: 0644]
fs/xfs/scrub/fscounters.c
fs/xfs/scrub/rtbitmap.c
fs/xfs/scrub/rtsummary.c
fs/xfs/xfs_fsmap.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_rtalloc.h

index 617cc7e78e3845a7056a35da88d055d57ac0f36d..a47da8d3d1bce4847dcc11fcea6ec9abba40b000 100644 (file)
@@ -21,7 +21,7 @@
 #include "xfs_bmap.h"
 #include "xfs_bmap_util.h"
 #include "xfs_bmap_btree.h"
-#include "xfs_rtalloc.h"
+#include "xfs_rtbitmap.h"
 #include "xfs_errortag.h"
 #include "xfs_error.h"
 #include "xfs_quota.h"
index 655108a4cd05d7bdfac12be96b884e2c9c23d969..9eb1b5aa7e35a62273fd55f3ea8470849ef4a51a 100644 (file)
@@ -16,6 +16,7 @@
 #include "xfs_trans.h"
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
+#include "xfs_rtbitmap.h"
 
 /*
  * Realtime allocator bitmap functions shared with userspace.
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.h b/fs/xfs/libxfs/xfs_rtbitmap.h
new file mode 100644 (file)
index 0000000..546dea3
--- /dev/null
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ */
+#ifndef __XFS_RTBITMAP_H__
+#define        __XFS_RTBITMAP_H__
+
+/*
+ * XXX: Most of the realtime allocation functions deal in units of realtime
+ * extents, not realtime blocks.  This looks funny when paired with the type
+ * name and screams for a larger cleanup.
+ */
+struct xfs_rtalloc_rec {
+       xfs_rtblock_t           ar_startext;
+       xfs_rtblock_t           ar_extcount;
+};
+
+typedef int (*xfs_rtalloc_query_range_fn)(
+       struct xfs_mount                *mp,
+       struct xfs_trans                *tp,
+       const struct xfs_rtalloc_rec    *rec,
+       void                            *priv);
+
+#ifdef CONFIG_XFS_RT
+int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp,
+                 xfs_rtblock_t block, int issum, struct xfs_buf **bpp);
+int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp,
+                     xfs_rtblock_t start, xfs_extlen_t len, int val,
+                     xfs_rtblock_t *new, int *stat);
+int xfs_rtfind_back(struct xfs_mount *mp, struct xfs_trans *tp,
+                   xfs_rtblock_t start, xfs_rtblock_t limit,
+                   xfs_rtblock_t *rtblock);
+int xfs_rtfind_forw(struct xfs_mount *mp, struct xfs_trans *tp,
+                   xfs_rtblock_t start, xfs_rtblock_t limit,
+                   xfs_rtblock_t *rtblock);
+int xfs_rtmodify_range(struct xfs_mount *mp, struct xfs_trans *tp,
+                      xfs_rtblock_t start, xfs_extlen_t len, int val);
+int xfs_rtmodify_summary_int(struct xfs_mount *mp, struct xfs_trans *tp,
+                            int log, xfs_rtblock_t bbno, int delta,
+                            struct xfs_buf **rbpp, xfs_fsblock_t *rsb,
+                            xfs_suminfo_t *sum);
+int xfs_rtmodify_summary(struct xfs_mount *mp, struct xfs_trans *tp, int log,
+                        xfs_rtblock_t bbno, int delta, struct xfs_buf **rbpp,
+                        xfs_fsblock_t *rsb);
+int xfs_rtfree_range(struct xfs_mount *mp, struct xfs_trans *tp,
+                    xfs_rtblock_t start, xfs_extlen_t len,
+                    struct xfs_buf **rbpp, xfs_fsblock_t *rsb);
+int xfs_rtalloc_query_range(struct xfs_mount *mp, struct xfs_trans *tp,
+               const struct xfs_rtalloc_rec *low_rec,
+               const struct xfs_rtalloc_rec *high_rec,
+               xfs_rtalloc_query_range_fn fn, void *priv);
+int xfs_rtalloc_query_all(struct xfs_mount *mp, struct xfs_trans *tp,
+                         xfs_rtalloc_query_range_fn fn,
+                         void *priv);
+bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
+int xfs_rtalloc_extent_is_free(struct xfs_mount *mp, struct xfs_trans *tp,
+                              xfs_rtblock_t start, xfs_extlen_t len,
+                              bool *is_free);
+/*
+ * Free an extent in the realtime subvolume.  Length is expressed in
+ * realtime extents, as is the block number.
+ */
+int                                    /* error */
+xfs_rtfree_extent(
+       struct xfs_trans        *tp,    /* transaction pointer */
+       xfs_rtblock_t           bno,    /* starting block number to free */
+       xfs_extlen_t            len);   /* length of extent freed */
+
+/* Same as above, but in units of rt blocks. */
+int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno,
+               xfs_filblks_t rtlen);
+#else /* CONFIG_XFS_RT */
+# define xfs_rtfree_extent(t,b,l)                      (-ENOSYS)
+# define xfs_rtfree_blocks(t,rb,rl)                    (-ENOSYS)
+# define xfs_rtalloc_query_range(m,t,l,h,f,p)          (-ENOSYS)
+# define xfs_rtalloc_query_all(m,t,f,p)                        (-ENOSYS)
+# define xfs_rtbuf_get(m,t,b,i,p)                      (-ENOSYS)
+# define xfs_rtalloc_extent_is_free(m,t,s,l,i)         (-ENOSYS)
+#endif /* CONFIG_XFS_RT */
+
+#endif /* __XFS_RTBITMAP_H__ */
index 05be757668bb25ca0bef1d7db4fb0ea5bd996738..5799e9a94f1f665dba31af5b5908248311aa1fb1 100644 (file)
@@ -16,7 +16,7 @@
 #include "xfs_health.h"
 #include "xfs_btree.h"
 #include "xfs_ag.h"
-#include "xfs_rtalloc.h"
+#include "xfs_rtbitmap.h"
 #include "xfs_inode.h"
 #include "xfs_icache.h"
 #include "scrub/scrub.h"
index 008ddb599e13244b9fcbb57e99191e59035e08dd..2e5fd52f7af3ab1f93c5f3926612b6aad17b87f4 100644 (file)
@@ -11,7 +11,7 @@
 #include "xfs_mount.h"
 #include "xfs_log_format.h"
 #include "xfs_trans.h"
-#include "xfs_rtalloc.h"
+#include "xfs_rtbitmap.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
 #include "scrub/scrub.h"
index 437ed9acbb27383e7a389ff2526f9ba4e1cdd04d..f4635a920470e1f944ea2c303852a462ef3ebbeb 100644 (file)
@@ -13,7 +13,7 @@
 #include "xfs_inode.h"
 #include "xfs_log_format.h"
 #include "xfs_trans.h"
-#include "xfs_rtalloc.h"
+#include "xfs_rtbitmap.h"
 #include "xfs_bit.h"
 #include "xfs_bmap.h"
 #include "scrub/scrub.h"
index 736e5545f584025ec204dfc6059e83fc06e99bdb..8982c5d6cbd0653e2e7f67c5af69ef2f4b8f9ea3 100644 (file)
@@ -23,7 +23,7 @@
 #include "xfs_refcount.h"
 #include "xfs_refcount_btree.h"
 #include "xfs_alloc_btree.h"
-#include "xfs_rtalloc.h"
+#include "xfs_rtbitmap.h"
 #include "xfs_ag.h"
 
 /* Convert an xfs_fsmap to an fsmap. */
index 0e4e2df08aed07753d62749ed3ad82f3d484f1f4..f2eb0c8b595db4fd08af08c54ba5f677c2f2c6e5 100644 (file)
@@ -19,6 +19,7 @@
 #include "xfs_icache.h"
 #include "xfs_rtalloc.h"
 #include "xfs_sb.h"
+#include "xfs_rtbitmap.h"
 
 /*
  * Read and return the summary information for a given extent size,
index 65c284e9d33e93df0a07914e17a1fd98437e83d2..11859c259a1c43c44db0e8c07d6a68ed506dda04 100644 (file)
 struct xfs_mount;
 struct xfs_trans;
 
-/*
- * XXX: Most of the realtime allocation functions deal in units of realtime
- * extents, not realtime blocks.  This looks funny when paired with the type
- * name and screams for a larger cleanup.
- */
-struct xfs_rtalloc_rec {
-       xfs_rtblock_t           ar_startext;
-       xfs_rtblock_t           ar_extcount;
-};
-
-typedef int (*xfs_rtalloc_query_range_fn)(
-       struct xfs_mount                *mp,
-       struct xfs_trans                *tp,
-       const struct xfs_rtalloc_rec    *rec,
-       void                            *priv);
-
 #ifdef CONFIG_XFS_RT
 /*
  * Function prototypes for exported functions.
@@ -48,19 +32,6 @@ xfs_rtallocate_extent(
        xfs_extlen_t            prod,   /* extent product factor */
        xfs_rtblock_t           *rtblock); /* out: start block allocated */
 
-/*
- * Free an extent in the realtime subvolume.  Length is expressed in
- * realtime extents, as is the block number.
- */
-int                                    /* error */
-xfs_rtfree_extent(
-       struct xfs_trans        *tp,    /* transaction pointer */
-       xfs_rtblock_t           bno,    /* starting block number to free */
-       xfs_extlen_t            len);   /* length of extent freed */
-
-/* Same as above, but in units of rt blocks. */
-int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno,
-               xfs_filblks_t rtlen);
 
 /*
  * Initialize realtime fields in the mount structure.
@@ -102,55 +73,11 @@ xfs_growfs_rt(
        struct xfs_mount        *mp,    /* file system mount structure */
        xfs_growfs_rt_t         *in);   /* user supplied growfs struct */
 
-/*
- * From xfs_rtbitmap.c
- */
-int xfs_rtbuf_get(struct xfs_mount *mp, struct xfs_trans *tp,
-                 xfs_rtblock_t block, int issum, struct xfs_buf **bpp);
-int xfs_rtcheck_range(struct xfs_mount *mp, struct xfs_trans *tp,
-                     xfs_rtblock_t start, xfs_extlen_t len, int val,
-                     xfs_rtblock_t *new, int *stat);
-int xfs_rtfind_back(struct xfs_mount *mp, struct xfs_trans *tp,
-                   xfs_rtblock_t start, xfs_rtblock_t limit,
-                   xfs_rtblock_t *rtblock);
-int xfs_rtfind_forw(struct xfs_mount *mp, struct xfs_trans *tp,
-                   xfs_rtblock_t start, xfs_rtblock_t limit,
-                   xfs_rtblock_t *rtblock);
-int xfs_rtmodify_range(struct xfs_mount *mp, struct xfs_trans *tp,
-                      xfs_rtblock_t start, xfs_extlen_t len, int val);
-int xfs_rtmodify_summary_int(struct xfs_mount *mp, struct xfs_trans *tp,
-                            int log, xfs_rtblock_t bbno, int delta,
-                            struct xfs_buf **rbpp, xfs_fsblock_t *rsb,
-                            xfs_suminfo_t *sum);
-int xfs_rtmodify_summary(struct xfs_mount *mp, struct xfs_trans *tp, int log,
-                        xfs_rtblock_t bbno, int delta, struct xfs_buf **rbpp,
-                        xfs_fsblock_t *rsb);
-int xfs_rtfree_range(struct xfs_mount *mp, struct xfs_trans *tp,
-                    xfs_rtblock_t start, xfs_extlen_t len,
-                    struct xfs_buf **rbpp, xfs_fsblock_t *rsb);
-int xfs_rtalloc_query_range(struct xfs_mount *mp, struct xfs_trans *tp,
-               const struct xfs_rtalloc_rec *low_rec,
-               const struct xfs_rtalloc_rec *high_rec,
-               xfs_rtalloc_query_range_fn fn, void *priv);
-int xfs_rtalloc_query_all(struct xfs_mount *mp, struct xfs_trans *tp,
-                         xfs_rtalloc_query_range_fn fn,
-                         void *priv);
-bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
-int xfs_rtalloc_extent_is_free(struct xfs_mount *mp, struct xfs_trans *tp,
-                              xfs_rtblock_t start, xfs_extlen_t len,
-                              bool *is_free);
 int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp);
 #else
 # define xfs_rtallocate_extent(t,b,min,max,l,f,p,rb)   (-ENOSYS)
-# define xfs_rtfree_extent(t,b,l)                      (-ENOSYS)
-# define xfs_rtfree_blocks(t,rb,rl)                    (-ENOSYS)
 # define xfs_rtpick_extent(m,t,l,rb)                   (-ENOSYS)
 # define xfs_growfs_rt(mp,in)                          (-ENOSYS)
-# define xfs_rtalloc_query_range(m,t,l,h,f,p)          (-ENOSYS)
-# define xfs_rtalloc_query_all(m,t,f,p)                        (-ENOSYS)
-# define xfs_rtbuf_get(m,t,b,i,p)                      (-ENOSYS)
-# define xfs_verify_rtbno(m, r)                                (false)
-# define xfs_rtalloc_extent_is_free(m,t,s,l,i)         (-ENOSYS)
 # define xfs_rtalloc_reinit_frextents(m)               (0)
 static inline int              /* error */
 xfs_rtmount_init(