diff mbox series

[v3,04/13] btrfs: fiemap: emit new COMPRESSED state.

Message ID ed3a3c3edbf01b728c20c0718d227ebb79611f47.1712126039.git.sweettea-kernel@dorminy.me (mailing list archive)
State New, archived
Headers show
Series fiemap extension for more physical information | expand

Commit Message

Sweet Tea Dorminy April 3, 2024, 7:22 a.m. UTC
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
---
 fs/btrfs/extent_io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andreas Dilger April 5, 2024, 7:10 p.m. UTC | #1
On Apr 3, 2024, at 1:22 AM, Sweet Tea Dorminy <sweettea-kernel@dorminy.me> wrote:
> 
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

I would recommend to merge this with the 05/13 patch that is setting the btrfs
fe_physical_length field.  Otherwise, by itself it would be confusing that the
DATA_COMPRESSED flag is set on the extent without fe_physical_length being set
to be able to do anything with that information.

Cheers, Andreas

> ---
> fs/btrfs/extent_io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 9e421d99fd5c..e9df670ef7d2 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2706,7 +2706,7 @@ static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo,
> 			if (range_end <= cache_end)
> 				return 0;
> 
> -			if (!(flags & (FIEMAP_EXTENT_ENCODED | FIEMAP_EXTENT_DELALLOC)))
> +			if (!(flags & (FIEMAP_EXTENT_DATA_COMPRESSED | FIEMAP_EXTENT_DELALLOC)))
> 				phys += cache_end - offset;
> 
> 			offset = cache_end;
> @@ -3236,7 +3236,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
> 		}
> 
> 		if (compression != BTRFS_COMPRESS_NONE)
> -			flags |= FIEMAP_EXTENT_ENCODED;
> +			flags |= FIEMAP_EXTENT_DATA_COMPRESSED;
> 
> 		if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> 			flags |= FIEMAP_EXTENT_DATA_INLINE;
> --
> 2.43.0
> 
> 


Cheers, Andreas
diff mbox series

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 9e421d99fd5c..e9df670ef7d2 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2706,7 +2706,7 @@  static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo,
 			if (range_end <= cache_end)
 				return 0;
 
-			if (!(flags & (FIEMAP_EXTENT_ENCODED | FIEMAP_EXTENT_DELALLOC)))
+			if (!(flags & (FIEMAP_EXTENT_DATA_COMPRESSED | FIEMAP_EXTENT_DELALLOC)))
 				phys += cache_end - offset;
 
 			offset = cache_end;
@@ -3236,7 +3236,7 @@  int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
 		}
 
 		if (compression != BTRFS_COMPRESS_NONE)
-			flags |= FIEMAP_EXTENT_ENCODED;
+			flags |= FIEMAP_EXTENT_DATA_COMPRESSED;
 
 		if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
 			flags |= FIEMAP_EXTENT_DATA_INLINE;