summaryrefslogtreecommitdiff
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-10-26 22:08:17 +0300
committerDavid Sterba <dsterba@suse.com>2022-12-05 20:00:45 +0300
commitb31bed170d5241d4c9e2fc572f31fc15b274a6c9 (patch)
tree1a223db25f54ffc79e2ef164b79f40337aa3ab66 /fs/btrfs/volumes.h
parentcb9a10a6504bb35095e97f4839fcf353bf1458ea (diff)
downloadlinux-b31bed170d5241d4c9e2fc572f31fc15b274a6c9.tar.xz
btrfs: move btrfs_chunk_item_size out of ctree.h
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>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index a20ee7d57831..b05124e62412 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -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,