]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: move btrfs_chunk_item_size out of ctree.h
authorJosef Bacik <josef@toxicpanda.com>
Wed, 26 Oct 2022 19:08:17 +0000 (15:08 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:45 +0000 (18:00 +0100)
This is used by the volumes code and the tree checker code.  We want to
maintain inline however, so simply move it to volumes.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/volumes.h

index 09005bd9bfef452663621cdb8e117345d4958999..1e0944c37547431da009c20e6fca6accd1ef2d00 100644 (file)
@@ -54,13 +54,6 @@ struct btrfs_balance_control;
 struct btrfs_delayed_root;
 struct reloc_control;
 
-static inline unsigned long btrfs_chunk_item_size(int num_stripes)
-{
-       BUG_ON(num_stripes == 0);
-       return sizeof(struct btrfs_chunk) +
-               sizeof(struct btrfs_stripe) * (num_stripes - 1);
-}
-
 /* Read ahead values for struct btrfs_path.reada */
 enum {
        READA_NONE,
index a20ee7d5783155cbf93ea3ba0440b221bb7956da..b05124e6241238480a41503e083c8726064d4e85 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/sort.h>
 #include <linux/btrfs.h>
 #include "async-thread.h"
+#include "messages.h"
 
 #define BTRFS_MAX_DATA_CHUNK_SIZE      (10ULL * SZ_1G)
 
@@ -605,6 +606,13 @@ static inline enum btrfs_map_op btrfs_op(struct bio *bio)
        }
 }
 
+static inline unsigned long btrfs_chunk_item_size(int num_stripes)
+{
+       ASSERT(num_stripes);
+       return sizeof(struct btrfs_chunk) +
+               sizeof(struct btrfs_stripe) * (num_stripes - 1);
+}
+
 void btrfs_get_bioc(struct btrfs_io_context *bioc);
 void btrfs_put_bioc(struct btrfs_io_context *bioc);
 int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,