diff mbox series

[41/45] xfs_spaceman: handle internal RT devices

Message ID 20250409075557.3535745-42-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/45] xfs: generalize the freespace and reserved blocks handling | expand

Commit Message

Christoph Hellwig April 9, 2025, 7:55 a.m. UTC
Handle the synthetic fmr_device values for fsmap.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 spaceman/freesp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong April 9, 2025, 7:29 p.m. UTC | #1
On Wed, Apr 09, 2025 at 09:55:44AM +0200, Christoph Hellwig wrote:
> Handle the synthetic fmr_device values for fsmap.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

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

--D

> ---
>  spaceman/freesp.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/spaceman/freesp.c b/spaceman/freesp.c
> index dfbec52a7160..9ad321c4843f 100644
> --- a/spaceman/freesp.c
> +++ b/spaceman/freesp.c
> @@ -140,12 +140,19 @@ scan_ag(
>  	if (agno != NULLAGNUMBER) {
>  		l->fmr_physical = cvt_agbno_to_b(xfd, agno, 0);
>  		h->fmr_physical = cvt_agbno_to_b(xfd, agno + 1, 0);
> -		l->fmr_device = h->fmr_device = file->fs_path.fs_datadev;
> +		if (file->xfd.fsgeom.rtstart)
> +			l->fmr_device = XFS_DEV_DATA;
> +		else
> +			l->fmr_device = file->fs_path.fs_datadev;
>  	} else {
>  		l->fmr_physical = 0;
>  		h->fmr_physical = ULLONG_MAX;
> -		l->fmr_device = h->fmr_device = file->fs_path.fs_rtdev;
> +		if (file->xfd.fsgeom.rtstart)
> +			l->fmr_device = XFS_DEV_RT;
> +		else
> +			l->fmr_device = file->fs_path.fs_rtdev;
>  	}
> +		h->fmr_device = l->fmr_device;
>  	h->fmr_owner = ULLONG_MAX;
>  	h->fmr_flags = UINT_MAX;
>  	h->fmr_offset = ULLONG_MAX;
> -- 
> 2.47.2
> 
>
diff mbox series

Patch

diff --git a/spaceman/freesp.c b/spaceman/freesp.c
index dfbec52a7160..9ad321c4843f 100644
--- a/spaceman/freesp.c
+++ b/spaceman/freesp.c
@@ -140,12 +140,19 @@  scan_ag(
 	if (agno != NULLAGNUMBER) {
 		l->fmr_physical = cvt_agbno_to_b(xfd, agno, 0);
 		h->fmr_physical = cvt_agbno_to_b(xfd, agno + 1, 0);
-		l->fmr_device = h->fmr_device = file->fs_path.fs_datadev;
+		if (file->xfd.fsgeom.rtstart)
+			l->fmr_device = XFS_DEV_DATA;
+		else
+			l->fmr_device = file->fs_path.fs_datadev;
 	} else {
 		l->fmr_physical = 0;
 		h->fmr_physical = ULLONG_MAX;
-		l->fmr_device = h->fmr_device = file->fs_path.fs_rtdev;
+		if (file->xfd.fsgeom.rtstart)
+			l->fmr_device = XFS_DEV_RT;
+		else
+			l->fmr_device = file->fs_path.fs_rtdev;
 	}
+		h->fmr_device = l->fmr_device;
 	h->fmr_owner = ULLONG_MAX;
 	h->fmr_flags = UINT_MAX;
 	h->fmr_offset = ULLONG_MAX;