linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandan Babu R <chandanrlinux@gmail.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH V2 04/12] xfs: Use xfs_extnum_t instead of basic data types
Date: Wed, 28 Jul 2021 09:08:28 +0530	[thread overview]
Message-ID: <87bl6nw1jf.fsf@garuda> (raw)
In-Reply-To: <20210727215924.GM559212@magnolia>

On 28 Jul 2021 at 03:29, Darrick J. Wong wrote:
> On Mon, Jul 26, 2021 at 05:15:33PM +0530, Chandan Babu R wrote:
>> xfs_extnum_t is the type to use to declare variables which have values
>> obtained from xfs_dinode->di_[a]nextents. This commit replaces basic
>> types (e.g. uint32_t) with xfs_extnum_t for such variables.
>>
>> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
>
> Not sure why the structure members change places, but otherwise LGTM.

The re-arrangement of local variables was supposed to happen in the patch
where "xfs_[a]extnum_t" get promoted to larger data types. I will make those
movements happen in that patch.

>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Thanks for the review.

>
> --D
>
>
>> ---
>>  fs/xfs/libxfs/xfs_bmap.c       | 2 +-
>>  fs/xfs/libxfs/xfs_inode_buf.c  | 2 +-
>>  fs/xfs/libxfs/xfs_inode_fork.c | 2 +-
>>  fs/xfs/scrub/inode.c           | 2 +-
>>  fs/xfs/scrub/inode_repair.c    | 2 +-
>>  fs/xfs/xfs_trace.h             | 2 +-
>>  6 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
>> index 282aeb3c0e49..e5d243fd187d 100644
>> --- a/fs/xfs/libxfs/xfs_bmap.c
>> +++ b/fs/xfs/libxfs/xfs_bmap.c
>> @@ -53,9 +53,9 @@ xfs_bmap_compute_maxlevels(
>>  	xfs_mount_t	*mp,		/* file system mount structure */
>>  	int		whichfork)	/* data or attr fork */
>>  {
>> +	xfs_extnum_t	maxleafents;	/* max leaf entries possible */
>>  	int		level;		/* btree level */
>>  	uint		maxblocks;	/* max blocks at this level */
>> -	uint		maxleafents;	/* max leaf entries possible */
>>  	int		maxrootrecs;	/* max records in root block */
>>  	int		minleafrecs;	/* min records in leaf block */
>>  	int		minnoderecs;	/* min records in node block */
>> diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
>> index 419b92dc6ac8..cba9a38f3270 100644
>> --- a/fs/xfs/libxfs/xfs_inode_buf.c
>> +++ b/fs/xfs/libxfs/xfs_inode_buf.c
>> @@ -342,7 +342,7 @@ xfs_dinode_verify_fork(
>>  	struct xfs_mount	*mp,
>>  	int			whichfork)
>>  {
>> -	uint32_t		di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork);
>> +	xfs_extnum_t		di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork);
>>  	xfs_extnum_t		max_extents;
>>
>>  	switch (XFS_DFORK_FORMAT(dip, whichfork)) {
>> diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
>> index c6856ec95335..a1e40df585a3 100644
>> --- a/fs/xfs/libxfs/xfs_inode_fork.c
>> +++ b/fs/xfs/libxfs/xfs_inode_fork.c
>> @@ -107,7 +107,7 @@ xfs_iformat_extents(
>>  	struct xfs_mount	*mp = ip->i_mount;
>>  	struct xfs_ifork	*ifp = XFS_IFORK_PTR(ip, whichfork);
>>  	int			state = xfs_bmap_fork_to_state(whichfork);
>> -	int			nex = XFS_DFORK_NEXTENTS(dip, whichfork);
>> +	xfs_extnum_t		nex = XFS_DFORK_NEXTENTS(dip, whichfork);
>>  	int			size = nex * sizeof(xfs_bmbt_rec_t);
>>  	struct xfs_iext_cursor	icur;
>>  	struct xfs_bmbt_rec	*dp;
>> diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
>> index e6068590484b..246d11ca133f 100644
>> --- a/fs/xfs/scrub/inode.c
>> +++ b/fs/xfs/scrub/inode.c
>> @@ -219,7 +219,7 @@ xchk_dinode(
>>  	size_t			fork_recs;
>>  	unsigned long long	isize;
>>  	uint64_t		flags2;
>> -	uint32_t		nextents;
>> +	xfs_extnum_t		nextents;
>>  	prid_t			prid;
>>  	uint16_t		flags;
>>  	uint16_t		mode;
>> diff --git a/fs/xfs/scrub/inode_repair.c b/fs/xfs/scrub/inode_repair.c
>> index a44d7b48c374..042c7d0bc0f5 100644
>> --- a/fs/xfs/scrub/inode_repair.c
>> +++ b/fs/xfs/scrub/inode_repair.c
>> @@ -597,9 +597,9 @@ xrep_dinode_bad_extents_fork(
>>  {
>>  	struct xfs_bmbt_irec	new;
>>  	struct xfs_bmbt_rec	*dp;
>> +	xfs_extnum_t		nex;
>>  	bool			isrt;
>>  	int			i;
>> -	int			nex;
>>  	int			fork_size;
>>
>>  	nex = XFS_DFORK_NEXTENTS(dip, whichfork);
>> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
>> index affc9b5834fb..5ed11f894f79 100644
>> --- a/fs/xfs/xfs_trace.h
>> +++ b/fs/xfs/xfs_trace.h
>> @@ -2338,7 +2338,7 @@ DECLARE_EVENT_CLASS(xfs_swap_extent_class,
>>  		__field(int, which)
>>  		__field(xfs_ino_t, ino)
>>  		__field(int, format)
>> -		__field(int, nex)
>> +		__field(xfs_extnum_t, nex)
>>  		__field(int, broot_size)
>>  		__field(int, fork_off)
>>  	),
>> --
>> 2.30.2
>>


--
chandan

  reply	other threads:[~2021-07-28  3:39 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 11:45 [PATCH V2 00/12] xfs: Extend per-inode extent counters Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 01/12] xfs: Move extent count limits to xfs_format.h Chandan Babu R
2021-07-26 18:00   ` Darrick J. Wong
2021-07-27  8:07     ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 02/12] xfs: Rename MAXEXTNUM, MAXAEXTNUM to XFS_IFORK_EXTCNT_MAXS32, XFS_IFORK_EXTCNT_MAXS16 Chandan Babu R
2021-07-27 21:56   ` Darrick J. Wong
2021-07-27 22:03     ` Darrick J. Wong
2021-07-28  3:15       ` Chandan Babu R
2021-08-23  4:18         ` Chandan Babu R
2021-08-23  7:17           ` Chandan Babu R
2021-08-23 18:16             ` Darrick J. Wong
2021-07-26 11:45 ` [PATCH V2 03/12] xfs: Introduce xfs_iext_max() helper Chandan Babu R
2021-07-27 21:58   ` Darrick J. Wong
2021-07-28  3:17     ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 04/12] xfs: Use xfs_extnum_t instead of basic data types Chandan Babu R
2021-07-27 21:59   ` Darrick J. Wong
2021-07-28  3:38     ` Chandan Babu R [this message]
2021-07-26 11:45 ` [PATCH V2 05/12] xfs: Introduce xfs_dfork_nextents() helper Chandan Babu R
2021-07-27 22:10   ` Darrick J. Wong
2021-07-28  4:06     ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 06/12] xfs: xfs_dfork_nextents: Return extent count via an out argument Chandan Babu R
2021-07-27 22:22   ` Darrick J. Wong
2021-07-28  4:21     ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 07/12] xfs: Rename inode's extent counter fields based on their width Chandan Babu R
2021-07-27 22:50   ` Darrick J. Wong
2021-07-28  5:48     ` Chandan Babu R
2021-07-28 19:04       ` Darrick J. Wong
2021-07-26 11:45 ` [PATCH V2 08/12] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Chandan Babu R
2021-07-27 22:29   ` Darrick J. Wong
2021-07-26 11:45 ` [PATCH V2 09/12] xfs: Rename XFS_IOC_BULKSTAT to XFS_IOC_BULKSTAT_V5 Chandan Babu R
2021-07-27 22:54   ` Darrick J. Wong
2021-07-27 23:00     ` Darrick J. Wong
2021-07-27 23:17       ` Dave Chinner
2021-07-28  6:56         ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 10/12] xfs: Enable bulkstat ioctl to support 64-bit extent counters Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 11/12] xfs: Extend per-inode extent counter widths Chandan Babu R
2021-07-27 23:09   ` Darrick J. Wong
2021-07-28  7:17     ` Chandan Babu R
2021-07-26 11:45 ` [PATCH V2 12/12] xfs: Error tag to test if v5 bulkstat skips inodes with large extent count Chandan Babu R
2021-07-27 23:10   ` Darrick J. Wong
2021-07-28  7:23     ` Chandan Babu R
2021-07-28  7:38       ` Chandan Babu R
2021-07-28 19:06         ` Darrick J. Wong
2021-07-28 21:27 ` [PATCH V2 00/12] xfs: Extend per-inode extent counters Darrick J. Wong
2021-07-29  6:40   ` Chandan Babu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl6nw1jf.fsf@garuda \
    --to=chandanrlinux@gmail.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).