linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix comments in definition of struct btrfs_file_extent_item
@ 2024-10-02 16:44 Mark Harmstone
  2024-10-02 18:20 ` Boris Burkov
  2024-10-02 21:21 ` Qu Wenruo
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Harmstone @ 2024-10-02 16:44 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Mark Harmstone

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>
---
 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


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

end of thread, other threads:[~2024-10-04 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-10-02 21:21 ` Qu Wenruo
2024-10-04 10:03   ` Yuwei Han

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).