diff mbox series

[06/17] btrfs: move maximum limits to btrfs_tree.h

Message ID e0640b40762be99c72f7bfbb295431d405624f1d.1663167823.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: initial ctree.h cleanups, simple stuff | expand

Commit Message

Josef Bacik Sept. 14, 2022, 3:06 p.m. UTC
We have maximum link and name length limits, move these to btrfs_tree.h
as they're on disk limitations.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h                | 13 -------------
 include/uapi/linux/btrfs_tree.h | 13 +++++++++++++
 2 files changed, 13 insertions(+), 13 deletions(-)

Comments

Qu Wenruo Sept. 15, 2022, 9:10 a.m. UTC | #1
On 2022/9/14 23:06, Josef Bacik wrote:
> We have maximum link and name length limits, move these to btrfs_tree.h
> as they're on disk limitations.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/ctree.h                | 13 -------------
>   include/uapi/linux/btrfs_tree.h | 13 +++++++++++++
>   2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index c3a8440d3223..5e6b025c0870 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -63,19 +63,6 @@ struct btrfs_ioctl_encoded_io_args;
>   
>   #define BTRFS_OLDEST_GENERATION	0ULL
>   
> -/*
> - * we can actually store much bigger names, but lets not confuse the rest
> - * of linux
> - */
> -#define BTRFS_NAME_LEN 255
> -
> -/*
> - * Theoretical limit is larger, but we keep this down to a sane
> - * value. That should limit greatly the possibility of collisions on
> - * inode ref items.
> - */
> -#define BTRFS_LINK_MAX 65535U
> -
>   #define BTRFS_EMPTY_DIR_SIZE 0
>   
>   #define BTRFS_DIRTY_METADATA_THRESH	SZ_32M
> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index e6bf902b9c92..c85e8c44ab92 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -14,6 +14,19 @@
>   
>   #define BTRFS_MAX_LEVEL 8
>   
> +/*
> + * we can actually store much bigger names, but lets not confuse the rest
> + * of linux
> + */
> +#define BTRFS_NAME_LEN 255
> +
> +/*
> + * Theoretical limit is larger, but we keep this down to a sane
> + * value. That should limit greatly the possibility of collisions on
> + * inode ref items.
> + */
> +#define BTRFS_LINK_MAX 65535U
> +
>   /*
>    * This header contains the structure definitions and constants used
>    * by file system objects that can be retrieved using
Johannes Thumshirn Sept. 15, 2022, 2:15 p.m. UTC | #2
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
In case the David approves the other 'move to btrfs_tree.h' patch.
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index c3a8440d3223..5e6b025c0870 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -63,19 +63,6 @@  struct btrfs_ioctl_encoded_io_args;
 
 #define BTRFS_OLDEST_GENERATION	0ULL
 
-/*
- * we can actually store much bigger names, but lets not confuse the rest
- * of linux
- */
-#define BTRFS_NAME_LEN 255
-
-/*
- * Theoretical limit is larger, but we keep this down to a sane
- * value. That should limit greatly the possibility of collisions on
- * inode ref items.
- */
-#define BTRFS_LINK_MAX 65535U
-
 #define BTRFS_EMPTY_DIR_SIZE 0
 
 #define BTRFS_DIRTY_METADATA_THRESH	SZ_32M
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index e6bf902b9c92..c85e8c44ab92 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -14,6 +14,19 @@ 
 
 #define BTRFS_MAX_LEVEL 8
 
+/*
+ * we can actually store much bigger names, but lets not confuse the rest
+ * of linux
+ */
+#define BTRFS_NAME_LEN 255
+
+/*
+ * Theoretical limit is larger, but we keep this down to a sane
+ * value. That should limit greatly the possibility of collisions on
+ * inode ref items.
+ */
+#define BTRFS_LINK_MAX 65535U
+
 /*
  * This header contains the structure definitions and constants used
  * by file system objects that can be retrieved using