public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static
@ 2026-01-09 15:18 Christoph Hellwig
  2026-01-09 15:18 ` [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-01-09 15:18 UTC (permalink / raw)
  To: cem; +Cc: linux-xfs

__xfs_rtgroup_extents is not used outside of xfs_rtgroup.c, so mark it
static.  Move it and xfs_rtgroup_extents up in the file to avoid forward
declarations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_rtgroup.c | 50 ++++++++++++++++++-------------------
 fs/xfs/libxfs/xfs_rtgroup.h |  2 --
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c
index 9186c58e83d5..5a3d0dc6ae1b 100644
--- a/fs/xfs/libxfs/xfs_rtgroup.c
+++ b/fs/xfs/libxfs/xfs_rtgroup.c
@@ -48,6 +48,31 @@ xfs_rtgroup_min_block(
 	return 0;
 }
 
+/* Compute the number of rt extents in this realtime group. */
+static xfs_rtxnum_t
+__xfs_rtgroup_extents(
+	struct xfs_mount	*mp,
+	xfs_rgnumber_t		rgno,
+	xfs_rgnumber_t		rgcount,
+	xfs_rtbxlen_t		rextents)
+{
+	ASSERT(rgno < rgcount);
+	if (rgno == rgcount - 1)
+		return rextents - ((xfs_rtxnum_t)rgno * mp->m_sb.sb_rgextents);
+
+	ASSERT(xfs_has_rtgroups(mp));
+	return mp->m_sb.sb_rgextents;
+}
+
+xfs_rtxnum_t
+xfs_rtgroup_extents(
+	struct xfs_mount	*mp,
+	xfs_rgnumber_t		rgno)
+{
+	return __xfs_rtgroup_extents(mp, rgno, mp->m_sb.sb_rgcount,
+			mp->m_sb.sb_rextents);
+}
+
 /* Precompute this group's geometry */
 void
 xfs_rtgroup_calc_geometry(
@@ -136,31 +161,6 @@ xfs_initialize_rtgroups(
 	return error;
 }
 
-/* Compute the number of rt extents in this realtime group. */
-xfs_rtxnum_t
-__xfs_rtgroup_extents(
-	struct xfs_mount	*mp,
-	xfs_rgnumber_t		rgno,
-	xfs_rgnumber_t		rgcount,
-	xfs_rtbxlen_t		rextents)
-{
-	ASSERT(rgno < rgcount);
-	if (rgno == rgcount - 1)
-		return rextents - ((xfs_rtxnum_t)rgno * mp->m_sb.sb_rgextents);
-
-	ASSERT(xfs_has_rtgroups(mp));
-	return mp->m_sb.sb_rgextents;
-}
-
-xfs_rtxnum_t
-xfs_rtgroup_extents(
-	struct xfs_mount	*mp,
-	xfs_rgnumber_t		rgno)
-{
-	return __xfs_rtgroup_extents(mp, rgno, mp->m_sb.sb_rgcount,
-			mp->m_sb.sb_rextents);
-}
-
 /*
  * Update the rt extent count of the previous tail rtgroup if it changed during
  * recovery (i.e. recovery of a growfs).
diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
index 03f1e2493334..73cace4d25c7 100644
--- a/fs/xfs/libxfs/xfs_rtgroup.h
+++ b/fs/xfs/libxfs/xfs_rtgroup.h
@@ -285,8 +285,6 @@ void xfs_free_rtgroups(struct xfs_mount *mp, xfs_rgnumber_t first_rgno,
 int xfs_initialize_rtgroups(struct xfs_mount *mp, xfs_rgnumber_t first_rgno,
 		xfs_rgnumber_t end_rgno, xfs_rtbxlen_t rextents);
 
-xfs_rtxnum_t __xfs_rtgroup_extents(struct xfs_mount *mp, xfs_rgnumber_t rgno,
-		xfs_rgnumber_t rgcount, xfs_rtbxlen_t rextents);
 xfs_rtxnum_t xfs_rtgroup_extents(struct xfs_mount *mp, xfs_rgnumber_t rgno);
 void xfs_rtgroup_calc_geometry(struct xfs_mount *mp, struct xfs_rtgroup *rtg,
 		xfs_rgnumber_t rgno, xfs_rgnumber_t rgcount,
-- 
2.47.3


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

* [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry
  2026-01-09 15:18 [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Christoph Hellwig
@ 2026-01-09 15:18 ` Christoph Hellwig
  2026-01-09 16:20   ` Darrick J. Wong
  2026-01-09 16:20 ` [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Darrick J. Wong
  2026-01-13 13:10 ` Carlos Maiolino
  2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-01-09 15:18 UTC (permalink / raw)
  To: cem; +Cc: linux-xfs

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_rtgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c
index 5a3d0dc6ae1b..be16efaa6925 100644
--- a/fs/xfs/libxfs/xfs_rtgroup.c
+++ b/fs/xfs/libxfs/xfs_rtgroup.c
@@ -83,7 +83,8 @@ xfs_rtgroup_calc_geometry(
 	xfs_rtbxlen_t		rextents)
 {
 	rtg->rtg_extents = __xfs_rtgroup_extents(mp, rgno, rgcount, rextents);
-	rtg_group(rtg)->xg_block_count = rtg->rtg_extents * mp->m_sb.sb_rextsize;
+	rtg_group(rtg)->xg_block_count =
+		rtg->rtg_extents * mp->m_sb.sb_rextsize;
 	rtg_group(rtg)->xg_min_gbno = xfs_rtgroup_min_block(mp, rgno);
 }
 
-- 
2.47.3


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

* Re: [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static
  2026-01-09 15:18 [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Christoph Hellwig
  2026-01-09 15:18 ` [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry Christoph Hellwig
@ 2026-01-09 16:20 ` Darrick J. Wong
  2026-01-13 13:10 ` Carlos Maiolino
  2 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2026-01-09 16:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: cem, linux-xfs

On Fri, Jan 09, 2026 at 04:18:53PM +0100, Christoph Hellwig wrote:
> __xfs_rtgroup_extents is not used outside of xfs_rtgroup.c, so mark it
> static.  Move it and xfs_rtgroup_extents up in the file to avoid forward
> declarations.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_rtgroup.c | 50 ++++++++++++++++++-------------------
>  fs/xfs/libxfs/xfs_rtgroup.h |  2 --
>  2 files changed, 25 insertions(+), 27 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c
> index 9186c58e83d5..5a3d0dc6ae1b 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.c
> +++ b/fs/xfs/libxfs/xfs_rtgroup.c
> @@ -48,6 +48,31 @@ xfs_rtgroup_min_block(
>  	return 0;
>  }
>  
> +/* Compute the number of rt extents in this realtime group. */
> +static xfs_rtxnum_t
> +__xfs_rtgroup_extents(
> +	struct xfs_mount	*mp,
> +	xfs_rgnumber_t		rgno,
> +	xfs_rgnumber_t		rgcount,
> +	xfs_rtbxlen_t		rextents)
> +{
> +	ASSERT(rgno < rgcount);
> +	if (rgno == rgcount - 1)
> +		return rextents - ((xfs_rtxnum_t)rgno * mp->m_sb.sb_rgextents);
> +
> +	ASSERT(xfs_has_rtgroups(mp));
> +	return mp->m_sb.sb_rgextents;
> +}
> +
> +xfs_rtxnum_t
> +xfs_rtgroup_extents(
> +	struct xfs_mount	*mp,
> +	xfs_rgnumber_t		rgno)
> +{
> +	return __xfs_rtgroup_extents(mp, rgno, mp->m_sb.sb_rgcount,
> +			mp->m_sb.sb_rextents);
> +}
> +
>  /* Precompute this group's geometry */
>  void
>  xfs_rtgroup_calc_geometry(
> @@ -136,31 +161,6 @@ xfs_initialize_rtgroups(
>  	return error;
>  }
>  
> -/* Compute the number of rt extents in this realtime group. */
> -xfs_rtxnum_t
> -__xfs_rtgroup_extents(
> -	struct xfs_mount	*mp,
> -	xfs_rgnumber_t		rgno,
> -	xfs_rgnumber_t		rgcount,
> -	xfs_rtbxlen_t		rextents)
> -{
> -	ASSERT(rgno < rgcount);
> -	if (rgno == rgcount - 1)
> -		return rextents - ((xfs_rtxnum_t)rgno * mp->m_sb.sb_rgextents);
> -
> -	ASSERT(xfs_has_rtgroups(mp));
> -	return mp->m_sb.sb_rgextents;
> -}
> -
> -xfs_rtxnum_t
> -xfs_rtgroup_extents(
> -	struct xfs_mount	*mp,
> -	xfs_rgnumber_t		rgno)
> -{
> -	return __xfs_rtgroup_extents(mp, rgno, mp->m_sb.sb_rgcount,
> -			mp->m_sb.sb_rextents);
> -}
> -
>  /*
>   * Update the rt extent count of the previous tail rtgroup if it changed during
>   * recovery (i.e. recovery of a growfs).
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
> index 03f1e2493334..73cace4d25c7 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.h
> +++ b/fs/xfs/libxfs/xfs_rtgroup.h
> @@ -285,8 +285,6 @@ void xfs_free_rtgroups(struct xfs_mount *mp, xfs_rgnumber_t first_rgno,
>  int xfs_initialize_rtgroups(struct xfs_mount *mp, xfs_rgnumber_t first_rgno,
>  		xfs_rgnumber_t end_rgno, xfs_rtbxlen_t rextents);
>  
> -xfs_rtxnum_t __xfs_rtgroup_extents(struct xfs_mount *mp, xfs_rgnumber_t rgno,
> -		xfs_rgnumber_t rgcount, xfs_rtbxlen_t rextents);
>  xfs_rtxnum_t xfs_rtgroup_extents(struct xfs_mount *mp, xfs_rgnumber_t rgno);
>  void xfs_rtgroup_calc_geometry(struct xfs_mount *mp, struct xfs_rtgroup *rtg,
>  		xfs_rgnumber_t rgno, xfs_rgnumber_t rgcount,
> -- 
> 2.47.3
> 
> 

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

* Re: [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry
  2026-01-09 15:18 ` [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry Christoph Hellwig
@ 2026-01-09 16:20   ` Darrick J. Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2026-01-09 16:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: cem, linux-xfs

On Fri, Jan 09, 2026 at 04:18:54PM +0100, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

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

--D

> ---
>  fs/xfs/libxfs/xfs_rtgroup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.c b/fs/xfs/libxfs/xfs_rtgroup.c
> index 5a3d0dc6ae1b..be16efaa6925 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.c
> +++ b/fs/xfs/libxfs/xfs_rtgroup.c
> @@ -83,7 +83,8 @@ xfs_rtgroup_calc_geometry(
>  	xfs_rtbxlen_t		rextents)
>  {
>  	rtg->rtg_extents = __xfs_rtgroup_extents(mp, rgno, rgcount, rextents);
> -	rtg_group(rtg)->xg_block_count = rtg->rtg_extents * mp->m_sb.sb_rextsize;
> +	rtg_group(rtg)->xg_block_count =
> +		rtg->rtg_extents * mp->m_sb.sb_rextsize;
>  	rtg_group(rtg)->xg_min_gbno = xfs_rtgroup_min_block(mp, rgno);
>  }
>  
> -- 
> 2.47.3
> 
> 

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

* Re: [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static
  2026-01-09 15:18 [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Christoph Hellwig
  2026-01-09 15:18 ` [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry Christoph Hellwig
  2026-01-09 16:20 ` [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Darrick J. Wong
@ 2026-01-13 13:10 ` Carlos Maiolino
  2 siblings, 0 replies; 5+ messages in thread
From: Carlos Maiolino @ 2026-01-13 13:10 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-xfs

On Fri, 09 Jan 2026 16:18:53 +0100, Christoph Hellwig wrote:
> __xfs_rtgroup_extents is not used outside of xfs_rtgroup.c, so mark it
> static.  Move it and xfs_rtgroup_extents up in the file to avoid forward
> declarations.
> 
> 

Applied to for-next, thanks!

[1/2] xfs: mark __xfs_rtgroup_extents static
      commit: e0aea42a32984a6fd13410aed7afd3bd0caeb1c1
[2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry
      commit: baed03efe223b1649320e835d7e0c03b3dde0b0c

Best regards,
-- 
Carlos Maiolino <cem@kernel.org>


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

end of thread, other threads:[~2026-01-13 13:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 15:18 [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Christoph Hellwig
2026-01-09 15:18 ` [PATCH 2/2] xfs: fix an overly long line in xfs_rtgroup_calc_geometry Christoph Hellwig
2026-01-09 16:20   ` Darrick J. Wong
2026-01-09 16:20 ` [PATCH 1/2] xfs: mark __xfs_rtgroup_extents static Darrick J. Wong
2026-01-13 13:10 ` Carlos Maiolino

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