summaryrefslogtreecommitdiff
path: root/fs/btrfs/messages.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-10-26 22:08:31 +0300
committerDavid Sterba <dsterba@suse.com>2022-12-05 20:00:46 +0300
commitb538a271ae9bd07e926b1e3bbfcd1aebf63e5860 (patch)
tree006d9c2d18de1d58e46658bbe0b5275f65ed29a1 /fs/btrfs/messages.h
parentaf142b6f44d36c4d0e1e53acbedbc30a588c58de (diff)
downloadlinux-b538a271ae9bd07e926b1e3bbfcd1aebf63e5860.tar.xz
btrfs: move the 32bit warn defines into messages.h
The code for these functions are in messages.c, move the defines and prototypes to messages.h. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> 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/messages.h')
-rw-r--r--fs/btrfs/messages.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/messages.h b/fs/btrfs/messages.h
index 3772358f8d30..5ac410e313e4 100644
--- a/fs/btrfs/messages.h
+++ b/fs/btrfs/messages.h
@@ -229,4 +229,17 @@ do { \
BUG(); \
} while (0)
+#if BITS_PER_LONG == 32
+#define BTRFS_32BIT_MAX_FILE_SIZE (((u64)ULONG_MAX + 1) << PAGE_SHIFT)
+/*
+ * The warning threshold is 5/8th of the MAX_LFS_FILESIZE that limits the logical
+ * addresses of extents.
+ *
+ * For 4K page size it's about 10T, for 64K it's 160T.
+ */
+#define BTRFS_32BIT_EARLY_WARN_THRESHOLD (BTRFS_32BIT_MAX_FILE_SIZE * 5 / 8)
+void btrfs_warn_32bit_limit(struct btrfs_fs_info *fs_info);
+void btrfs_err_32bit_limit(struct btrfs_fs_info *fs_info);
+#endif
+
#endif