[PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c

Josef Bacik
2022-09-14T23:05:12Z

We shouldn't have static_assert()'s in header files in general, but
especially since btrfs_super_block isn't defined in ctree.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
fs/btrfs/ctree.h | 1 -
fs/btrfs/fs.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a790c58b4c73..3cb4e0aca058 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -56,7 +56,6 @@ struct btrfs_ioctl_encoded_io_args;

#define BTRFS_SUPER_INFO_OFFSET SZ_64K
#define BTRFS_SUPER_INFO_SIZE 4096
-static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);

/*
* The reserved space at the beginning of each device.
diff --git a/fs/btrfs/fs.c b/fs/btrfs/fs.c
index a95d86679d14..c54ee0f943ce 100644
--- a/fs/btrfs/fs.c
+++ b/fs/btrfs/fs.c
@@ -106,3 +106,5 @@ int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
disk_super = fs_info->super_copy;
return !!(btrfs_super_compat_ro_flags(disk_super) & flag);
}
+
+static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
--
2.26.3