Skip to contentSkip to conversation

btrfs-progs: ctree.h: Sync the comment for btrfs_file_extent_item

PATCH Applied Qu Wenruo 3 participants 3 messages Dec 17, 2019 – Jan 2, 2020 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: ctree.h: Sync the comment for btrfs_file_extent_item

The comment about data checksum on disk_bytes is completely wrong.

Sync it with fixed kernel comment to avoid confusion.

---
 ctree.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
ctree.h +8 -4
index 3e50d086..9459adf1 100644
@@ -916,13 +916,16 @@ struct btrfs_file_extent_item {
 	u8 type;
 
 	/*
-	 * disk space consumed by the extent, checksum blocks are included
-	 * in these numbers
+	 * disk space consumed by the data extent
+	 * Data checksum is stored in csum tree, thus no bytenr/length takes
+	 * csum into consideration.
+	 *
+	 * At this offset in the structure, the inline extent data starts.
 	 */
 	__le64 disk_bytenr;
 	__le64 disk_num_bytes;
 	/*
-	 * the logical offset in file blocks (no csums)
+	 * the logical offset in file blocks
 	 * 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
@@ -930,7 +933,8 @@ struct btrfs_file_extent_item {
 	 */
 	__le64 offset;
 	/*
-	 * the logical number of file blocks (no csums included)
+	 * the logical number of file blocks. This always reflects the size
+	 * uncompressed and without encoding.
 	 */
 	__le64 num_bytes;
 
Signature · 1 line
2.24.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Qu Wenruo

The comment about data checksum on disk_bytes is completely wrong.

Sync it with fixed kernel comment to avoid confusion.

LGTM.

Quoted 39 lines
---
  ctree.h | 12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)
ctree.h +8 -4
index 3e50d086..9459adf1 100644
@@ -916,13 +916,16 @@ struct btrfs_file_extent_item {
  	u8 type;
 
  	/*
-	 * disk space consumed by the extent, checksum blocks are included
-	 * in these numbers
+	 * disk space consumed by the data extent
+	 * Data checksum is stored in csum tree, thus no bytenr/length takes
+	 * csum into consideration.
+	 *
+	 * At this offset in the structure, the inline extent data starts.
  	 */
  	__le64 disk_bytenr;
  	__le64 disk_num_bytes;
  	/*
-	 * the logical offset in file blocks (no csums)
+	 * the logical offset in file blocks
  	 * 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
@@ -930,7 +933,8 @@ struct btrfs_file_extent_item {
  	 */
  	__le64 offset;
  	/*
-	 * the logical number of file blocks (no csums included)
+	 * the logical number of file blocks. This always reflects the size
+	 * uncompressed and without encoding.
  	 */
  	__le64 num_bytes;