[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2587135E-3AF4-430A-89CF-5E49D229F2D3@dilger.ca>
Date: Fri, 5 Apr 2024 13:06:08 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: Sweet Tea Dorminy <sweettea-kernel@...miny.me>
Cc: Jonathan Corbet <corbet@....net>,
Kent Overstreet <kent.overstreet@...ux.dev>,
Brian Foster <bfoster@...hat.com>,
Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Chao Yu <chao@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>,
Mickaël Salaün <mic@...ikod.net>,
linux-doc@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-bcachefs@...r.kernel.org,
linux-btrfs <linux-btrfs@...r.kernel.org>,
linux-f2fs-devel@...ts.sourceforge.net,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
kernel-team@...a.com
Subject: Re: [PATCH v3 03/13] fiemap: add new COMPRESSED extent state
On Apr 3, 2024, at 1:22 AM, Sweet Tea Dorminy <sweettea-kernel@...miny.me> wrote:
>
> This goes closely with the new physical length field in struct
> fiemap_extent, as when physical length is not equal to logical length
> the reason is frequently compression.
>
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@...miny.me>
Looks good.
Reviewed-by: Andreas Dilger <adilger@...ger.ca>
> ---
> Documentation/filesystems/fiemap.rst | 4 ++++
> fs/ioctl.c | 3 ++-
> include/uapi/linux/fiemap.h | 2 ++
> 3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/filesystems/fiemap.rst b/Documentation/filesystems/fiemap.rst
> index c060bb83f5d8..16bd7faba5e0 100644
> --- a/Documentation/filesystems/fiemap.rst
> +++ b/Documentation/filesystems/fiemap.rst
> @@ -162,6 +162,10 @@ FIEMAP_EXTENT_DATA_ENCRYPTED
> This will also set FIEMAP_EXTENT_ENCODED
> The data in this extent has been encrypted by the file system.
>
> +FIEMAP_EXTENT_DATA_COMPRESSED
> + This will also set FIEMAP_EXTENT_ENCODED
> + The data in this extent is compressed by the file system.
> +
> FIEMAP_EXTENT_NOT_ALIGNED
> Extent offsets and length are not guaranteed to be block aligned.
>
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 1830baca532b..b47e2da7ec17 100644
> --- a/fs/ioctl.c
> +++ b/fs/ioctl.c
> @@ -126,7 +126,8 @@ int fiemap_fill_next_extent(struct fiemap_extent_info *fieinfo, u64 logical,
> return 1;
>
> #define SET_UNKNOWN_FLAGS (FIEMAP_EXTENT_DELALLOC)
> -#define SET_NO_UNMOUNTED_IO_FLAGS (FIEMAP_EXTENT_DATA_ENCRYPTED)
> +#define SET_NO_UNMOUNTED_IO_FLAGS (FIEMAP_EXTENT_DATA_ENCRYPTED|\
> + FIEMAP_EXTENT_DATA_COMPRESSED)
> #define SET_NOT_ALIGNED_FLAGS (FIEMAP_EXTENT_DATA_TAIL|FIEMAP_EXTENT_DATA_INLINE)
>
> if (flags & SET_UNKNOWN_FLAGS)
> diff --git a/include/uapi/linux/fiemap.h b/include/uapi/linux/fiemap.h
> index 3079159b8e94..ea97e33ddbb3 100644
> --- a/include/uapi/linux/fiemap.h
> +++ b/include/uapi/linux/fiemap.h
> @@ -67,6 +67,8 @@ struct fiemap {
> * Sets EXTENT_UNKNOWN. */
> #define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read
> * while fs is unmounted */
> +#define FIEMAP_EXTENT_DATA_COMPRESSED 0x00000040 /* Data is compressed by fs.
> + * Sets EXTENT_ENCODED. */
> #define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs.
> * Sets EXTENT_NO_BYPASS. */
> #define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be
> --
> 2.43.0
>
>
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists