From: Boris Burkov <boris@bur.io>
To: Mark Harmstone <maharmstone@fb.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix comments in definition of struct btrfs_file_extent_item
Date: Wed, 2 Oct 2024 11:20:40 -0700 [thread overview]
Message-ID: <20241002182040.GA3917419@zen.localdomain> (raw)
In-Reply-To: <20241002164500.2775775-1-maharmstone@fb.com>
On Wed, Oct 02, 2024 at 05:44:45PM +0100, Mark Harmstone wrote:
> The comments in the definition of struct btrfs_file_extent_item were
> written while the FS was still in flux, and are no longer accurate.
>
> The range [disk_bytenr, disk_num_bytes) is the same as the extent in the
> extent tree. There's no difference here between csummed and non-csummed
> extents, as the comments were implying. And the fields offset and
> num_bytes are in bytes, not file blocks.
>
> Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
> include/uapi/linux/btrfs_tree.h | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index fc29d273845d..5df54a11c74c 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -1094,24 +1094,23 @@ struct btrfs_file_extent_item {
> __u8 type;
>
> /*
> - * disk space consumed by the extent, checksum blocks are included
> - * in these numbers
> + * The address and size of the referenced extent. These should exactly
> + * match an entry in the extent tree.
> *
> * At this offset in the structure, the inline extent data start.
> */
> __le64 disk_bytenr;
> __le64 disk_num_bytes;
> /*
> - * the logical offset in file blocks (no csums)
> - * this extent record is for. This allows a file extent to point
> - * into the middle of an existing extent on disk, sharing it
> - * between two snapshots (useful if some bytes in the middle of the
> - * extent have changed
> + * The logical offset in bytes this extent record is for.
> + * This allows a file extent to point into the middle of an existing
> + * extent on disk, sharing it between two snapshots (useful if some
> + * bytes in the middle of the extent have changed)
> */
> __le64 offset;
> /*
> - * the logical number of file blocks (no csums included). This
> - * always reflects the size uncompressed and without encoding.
> + * The logical number of bytes. This always reflects the size
> + * uncompressed and without encoding.
> */
> __le64 num_bytes;
>
> --
> 2.44.2
>
next prev parent reply other threads:[~2024-10-02 18:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 16:44 [PATCH] btrfs: fix comments in definition of struct btrfs_file_extent_item Mark Harmstone
2024-10-02 18:20 ` Boris Burkov [this message]
2024-10-02 21:21 ` Qu Wenruo
2024-10-04 10:03 ` Yuwei Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241002182040.GA3917419@zen.localdomain \
--to=boris@bur.io \
--cc=linux-btrfs@vger.kernel.org \
--cc=maharmstone@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).