mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: remove a few duplicated lines
@ 2026-11-26 12:22 Zizhi Wo
  2026-11-26 13:26 ` Carlos Maiolino
  0 siblings, 1 reply; 3+ messages in thread
From: Zizhi Wo @ 2026-11-26 12:22 UTC (permalink / raw)
  To: cem, dgc, djwong, hch, linux-xfs
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

From: Zizhi Wo <wozizhi@huawei.com>

Remove duplicated lines:
- xfs_alloc_read_agf() checks pagf_freeblks twice.
- xfs_ondisk.h checks the size of struct xfs_attrlist twice.
- xfs_rtgroup.h declares xfs_rtginode_irele() twice.

No functional changes.

Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
---
 fs/xfs/libxfs/xfs_alloc.c   | 1 -
 fs/xfs/libxfs/xfs_ondisk.h  | 1 -
 fs/xfs/libxfs/xfs_rtgroup.h | 2 --
 3 files changed, 4 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index ae221a158764..2c5b73803a6b 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -3509,7 +3509,6 @@ xfs_alloc_read_agf(
 	if (!xfs_is_shutdown(pag_mount(pag))) {
 		bool	ok = true;
 
-		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
 		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
 		ok &= pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks);
 		ok &= pag->pagf_flcount == be32_to_cpu(agf->agf_flcount);
diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
index 23cde1248f01..ae16b1bc2bbe 100644
--- a/fs/xfs/libxfs/xfs_ondisk.h
+++ b/fs/xfs/libxfs/xfs_ondisk.h
@@ -305,7 +305,6 @@ xfs_check_ondisk_structs(void)
 	XFS_CHECK_STRUCT_SIZE(struct getbmapx,			48);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor,	16);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
-	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent,		4);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry,		128);
 	XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry,	128);
diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
index fca2eb74908c..e505be68462b 100644
--- a/fs/xfs/libxfs/xfs_rtgroup.h
+++ b/fs/xfs/libxfs/xfs_rtgroup.h
@@ -328,8 +328,6 @@ int xfs_rtginode_create(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
 		bool init);
 void xfs_rtginode_irele(struct xfs_inode **ipp);
 
-void xfs_rtginode_irele(struct xfs_inode **ipp);
-
 static inline const char *xfs_rtginode_path(xfs_rgnumber_t rgno,
 		enum xfs_rtg_inodes type)
 {
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs: remove a few duplicated lines
  2026-11-26 12:22 [PATCH] xfs: remove a few duplicated lines Zizhi Wo
@ 2026-11-26 13:26 ` Carlos Maiolino
  2026-11-26 13:43   ` Zizhi Wo
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Maiolino @ 2026-11-26 13:26 UTC (permalink / raw)
  To: Zizhi Wo
  Cc: dgc, djwong, hch, linux-xfs, linux-kernel, yangerkun,
	chengzhihao1, wozizhi

On Thu, Nov 26, 2026 at 08:22:29PM +0800, Zizhi Wo wrote:
> From: Zizhi Wo <wozizhi@huawei.com>
> 
> Remove duplicated lines:
> - xfs_alloc_read_agf() checks pagf_freeblks twice.
> - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
> - xfs_rtgroup.h declares xfs_rtginode_irele() twice.
> 
> No functional changes.

This patch does not apply cleanly as it conflicts with another patch
that has been enqueued in for-next for almost a month...

Please make sure your patches apply cleanly to xfs-linux/for-next before
submitting them.

Also add the proper "Fixes:" tags as appropriate.

> 
> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c   | 1 -
>  fs/xfs/libxfs/xfs_ondisk.h  | 1 -
>  fs/xfs/libxfs/xfs_rtgroup.h | 2 --
>  3 files changed, 4 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index ae221a158764..2c5b73803a6b 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -3509,7 +3509,6 @@ xfs_alloc_read_agf(
>  	if (!xfs_is_shutdown(pag_mount(pag))) {
>  		bool	ok = true;
>  
> -		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
>  		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
>  		ok &= pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks);
>  		ok &= pag->pagf_flcount == be32_to_cpu(agf->agf_flcount);
> diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
> index 23cde1248f01..ae16b1bc2bbe 100644
> --- a/fs/xfs/libxfs/xfs_ondisk.h
> +++ b/fs/xfs/libxfs/xfs_ondisk.h
> @@ -305,7 +305,6 @@ xfs_check_ondisk_structs(void)
>  	XFS_CHECK_STRUCT_SIZE(struct getbmapx,			48);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor,	16);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
> -	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent,		4);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry,		128);
>  	XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry,	128);
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
> index fca2eb74908c..e505be68462b 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.h
> +++ b/fs/xfs/libxfs/xfs_rtgroup.h
> @@ -328,8 +328,6 @@ int xfs_rtginode_create(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
>  		bool init);
>  void xfs_rtginode_irele(struct xfs_inode **ipp);
>  
> -void xfs_rtginode_irele(struct xfs_inode **ipp);
> -
>  static inline const char *xfs_rtginode_path(xfs_rgnumber_t rgno,
>  		enum xfs_rtg_inodes type)
>  {
> -- 
> 2.53.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs: remove a few duplicated lines
  2026-11-26 13:26 ` Carlos Maiolino
@ 2026-11-26 13:43   ` Zizhi Wo
  0 siblings, 0 replies; 3+ messages in thread
From: Zizhi Wo @ 2026-11-26 13:43 UTC (permalink / raw)
  To: Carlos Maiolino, Zizhi Wo
  Cc: dgc, djwong, hch, linux-xfs, linux-kernel, yangerkun, chengzhihao1



在 2026/11/26 21:26, Carlos Maiolino 写道:
> On Thu, Nov 26, 2026 at 08:22:29PM +0800, Zizhi Wo wrote:
>> From: Zizhi Wo <wozizhi@huawei.com>
>>
>> Remove duplicated lines:
>> - xfs_alloc_read_agf() checks pagf_freeblks twice.
>> - xfs_ondisk.h checks the size of struct xfs_attrlist twice.
>> - xfs_rtgroup.h declares xfs_rtginode_irele() twice.
>>
>> No functional changes.
> 
> This patch does not apply cleanly as it conflicts with another patch
> that has been enqueued in for-next for almost a month...
> 
> Please make sure your patches apply cleanly to xfs-linux/for-next before
> submitting them.

Sorry, I sent this one too quickly. I'll make sure to rebase and test
against xfs-linux/for-next before sending patches next time.

> 
> Also add the proper "Fixes:" tags as appropriate.

I originally treated this as a pure cleanup and didn't add fixtag. I'll
include the appropriate ones in V2, and drop the xfs_alloc_read_agf
hunk.

Thanks,
Zizhi Wo

> 
>>
>> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
>> ---
>>   fs/xfs/libxfs/xfs_alloc.c   | 1 -
>>   fs/xfs/libxfs/xfs_ondisk.h  | 1 -
>>   fs/xfs/libxfs/xfs_rtgroup.h | 2 --
>>   3 files changed, 4 deletions(-)
>>
>> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
>> index ae221a158764..2c5b73803a6b 100644
>> --- a/fs/xfs/libxfs/xfs_alloc.c
>> +++ b/fs/xfs/libxfs/xfs_alloc.c
>> @@ -3509,7 +3509,6 @@ xfs_alloc_read_agf(
>>   	if (!xfs_is_shutdown(pag_mount(pag))) {
>>   		bool	ok = true;
>>   
>> -		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
>>   		ok &= pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks);
>>   		ok &= pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks);
>>   		ok &= pag->pagf_flcount == be32_to_cpu(agf->agf_flcount);
>> diff --git a/fs/xfs/libxfs/xfs_ondisk.h b/fs/xfs/libxfs/xfs_ondisk.h
>> index 23cde1248f01..ae16b1bc2bbe 100644
>> --- a/fs/xfs/libxfs/xfs_ondisk.h
>> +++ b/fs/xfs/libxfs/xfs_ondisk.h
>> @@ -305,7 +305,6 @@ xfs_check_ondisk_structs(void)
>>   	XFS_CHECK_STRUCT_SIZE(struct getbmapx,			48);
>>   	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_cursor,	16);
>>   	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
>> -	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist,		8);
>>   	XFS_CHECK_STRUCT_SIZE(struct xfs_attrlist_ent,		4);
>>   	XFS_CHECK_STRUCT_SIZE(struct xfs_ag_geometry,		128);
>>   	XFS_CHECK_STRUCT_SIZE(struct xfs_rtgroup_geometry,	128);
>> diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
>> index fca2eb74908c..e505be68462b 100644
>> --- a/fs/xfs/libxfs/xfs_rtgroup.h
>> +++ b/fs/xfs/libxfs/xfs_rtgroup.h
>> @@ -328,8 +328,6 @@ int xfs_rtginode_create(struct xfs_rtgroup *rtg, enum xfs_rtg_inodes type,
>>   		bool init);
>>   void xfs_rtginode_irele(struct xfs_inode **ipp);
>>   
>> -void xfs_rtginode_irele(struct xfs_inode **ipp);
>> -
>>   static inline const char *xfs_rtginode_path(xfs_rgnumber_t rgno,
>>   		enum xfs_rtg_inodes type)
>>   {
>> -- 
>> 2.53.0
>>
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-26 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 12:22 [PATCH] xfs: remove a few duplicated lines Zizhi Wo
2026-11-26 13:26 ` Carlos Maiolino
2026-11-26 13:43   ` Zizhi Wo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®