diff mbox series

[V2,01/12] xfs: Move extent count limits to xfs_format.h

Message ID 20210726114541.24898-2-chandanrlinux@gmail.com (mailing list archive)
State Superseded, archived
Headers show
Series xfs: Extend per-inode extent counters | expand

Commit Message

Chandan Babu R July 26, 2021, 11:45 a.m. UTC
Maximum values associated with extent counters i.e. Maximum extent length,
Maximum data extents and Maximum xattr extents are dictated by the on-disk
format. Hence move these definitions over to xfs_format.h.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
---
 fs/xfs/libxfs/xfs_format.h | 7 +++++++
 fs/xfs/libxfs/xfs_types.h  | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Darrick J. Wong July 26, 2021, 6 p.m. UTC | #1
On Mon, Jul 26, 2021 at 05:15:30PM +0530, Chandan Babu R wrote:
> Maximum values associated with extent counters i.e. Maximum extent length,
> Maximum data extents and Maximum xattr extents are dictated by the on-disk
> format. Hence move these definitions over to xfs_format.h.
> 
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
> ---
>  fs/xfs/libxfs/xfs_format.h | 7 +++++++
>  fs/xfs/libxfs/xfs_types.h  | 7 -------
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
> index 8cd48a651b96..37cca918d2ba 100644
> --- a/fs/xfs/libxfs/xfs_format.h
> +++ b/fs/xfs/libxfs/xfs_format.h
> @@ -1109,6 +1109,13 @@ enum xfs_dinode_fmt {
>  	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
>  	{ XFS_DINODE_FMT_UUID,		"uuid" }
>  
> +/*
> + * Max values for extlen, extnum, aextnum.
> + */
> +#define	MAXEXTLEN	((uint32_t)0x001fffff)	/* 21 bits */
> +#define	MAXEXTNUM	((int32_t)0x7fffffff)	/* signed int */
> +#define	MAXAEXTNUM	((int16_t)0x7fff)	/* signed short */

Why do the cast types change here?  This is a simple hoist, right?

--D

> +
>  /*
>   * Inode minimum and maximum sizes.
>   */
> diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
> index 5c0cc806068b..8908346b1deb 100644
> --- a/fs/xfs/libxfs/xfs_types.h
> +++ b/fs/xfs/libxfs/xfs_types.h
> @@ -56,13 +56,6 @@ typedef void *		xfs_failaddr_t;
>  #define	NULLFSINO	((xfs_ino_t)-1)
>  #define	NULLAGINO	((xfs_agino_t)-1)
>  
> -/*
> - * Max values for extlen, extnum, aextnum.
> - */
> -#define	MAXEXTLEN	((xfs_extlen_t)0x001fffff)	/* 21 bits */
> -#define	MAXEXTNUM	((xfs_extnum_t)0x7fffffff)	/* signed int */
> -#define	MAXAEXTNUM	((xfs_aextnum_t)0x7fff)		/* signed short */
> -
>  /*
>   * Minimum and maximum blocksize and sectorsize.
>   * The blocksize upper limit is pretty much arbitrary.
> -- 
> 2.30.2
>
Chandan Babu R July 27, 2021, 8:07 a.m. UTC | #2
On 26 Jul 2021 at 23:30, Darrick J. Wong wrote:
> On Mon, Jul 26, 2021 at 05:15:30PM +0530, Chandan Babu R wrote:
>> Maximum values associated with extent counters i.e. Maximum extent length,
>> Maximum data extents and Maximum xattr extents are dictated by the on-disk
>> format. Hence move these definitions over to xfs_format.h.
>>
>> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
>> ---
>>  fs/xfs/libxfs/xfs_format.h | 7 +++++++
>>  fs/xfs/libxfs/xfs_types.h  | 7 -------
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
>> index 8cd48a651b96..37cca918d2ba 100644
>> --- a/fs/xfs/libxfs/xfs_format.h
>> +++ b/fs/xfs/libxfs/xfs_format.h
>> @@ -1109,6 +1109,13 @@ enum xfs_dinode_fmt {
>>  	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
>>  	{ XFS_DINODE_FMT_UUID,		"uuid" }
>>
>> +/*
>> + * Max values for extlen, extnum, aextnum.
>> + */
>> +#define	MAXEXTLEN	((uint32_t)0x001fffff)	/* 21 bits */
>> +#define	MAXEXTNUM	((int32_t)0x7fffffff)	/* signed int */
>> +#define	MAXAEXTNUM	((int16_t)0x7fff)	/* signed short */
>
> Why do the cast types change here?  This is a simple hoist, right?

Sorry, I will restore the casts to how it was earlier. I don't remember the
exact reason for changing them. I thought I had seen some compilation
issues. But after restoring them, I see that the code compiles fine.

--
chandan
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 8cd48a651b96..37cca918d2ba 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -1109,6 +1109,13 @@  enum xfs_dinode_fmt {
 	{ XFS_DINODE_FMT_BTREE,		"btree" }, \
 	{ XFS_DINODE_FMT_UUID,		"uuid" }
 
+/*
+ * Max values for extlen, extnum, aextnum.
+ */
+#define	MAXEXTLEN	((uint32_t)0x001fffff)	/* 21 bits */
+#define	MAXEXTNUM	((int32_t)0x7fffffff)	/* signed int */
+#define	MAXAEXTNUM	((int16_t)0x7fff)	/* signed short */
+
 /*
  * Inode minimum and maximum sizes.
  */
diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 5c0cc806068b..8908346b1deb 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -56,13 +56,6 @@  typedef void *		xfs_failaddr_t;
 #define	NULLFSINO	((xfs_ino_t)-1)
 #define	NULLAGINO	((xfs_agino_t)-1)
 
-/*
- * Max values for extlen, extnum, aextnum.
- */
-#define	MAXEXTLEN	((xfs_extlen_t)0x001fffff)	/* 21 bits */
-#define	MAXEXTNUM	((xfs_extnum_t)0x7fffffff)	/* signed int */
-#define	MAXAEXTNUM	((xfs_aextnum_t)0x7fff)		/* signed short */
-
 /*
  * Minimum and maximum blocksize and sectorsize.
  * The blocksize upper limit is pretty much arbitrary.