Skip to contentSkip to conversation

btrfs: Deprecate unused super block member, log_root_transid

PATCH Superseded Qu Wenruo 3 participants 3 messages Oct 12, 2018 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs: Deprecate unused super block member, log_root_transid

The member log_root_transid is never used.
It's always kept untouched even when updating log tree root.

And populating it without introducing new incompat flags could easily cause back-compatibility problems.
So just mark it unused.

---
 fs/btrfs/ctree.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/ctree.h +2 -4
index 53af9f5253f4..9adc53db679a 100644
@@ -214,8 +214,8 @@ struct btrfs_super_block {
 	__le64 chunk_root;
 	__le64 log_root;
 
-	/* this will help find the new super based on the log root */
-	__le64 log_root_transid;
+	/* This member is never touched, should always be 0 */
+	__le64 __unused_log_root_transid;
 	__le64 total_bytes;
 	__le64 bytes_used;
 	__le64 root_dir_objectid;
@@ -2317,8 +2317,6 @@ BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
 			 chunk_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
 			 log_root, 64);
-BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
-			 log_root_transid, 64);
 BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
 			 log_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,
Signature · 1 line
2.19.1
#1 lore raw
Quoted 17 lines · Qu Wenruo

The member log_root_transid is never used.
It's always kept untouched even when updating log tree root.

And populating it without introducing new incompat flags could easily cause back-compatibility problems.
So just mark it unused.

---
 fs/btrfs/ctree.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/ctree.h +0 -0
index 53af9f5253f4..9adc53db679a 100644

fs/btrfs/ctree.h struct btrfs_super_block { · line 218

Quoted 7 lines
fs/btrfs/ctree.h +2 -2
@@ -214,8 +214,8 @@ struct btrfs_super_block {
 	__le64 chunk_root;
 	__le64 log_root;
 
-	/* this will help find the new super based on the log root */
-	__le64 log_root_transid;
+	/* This member is never touched, should always be 0 */
+	__le64 __unused_log_root_transid;

no need to be that descriptive, that's the whole idea of switching the parameter's name. Just use "reserved1" or "unused" or "padding", also the name is eloquent enough that the comment is redundant.

Quoted 13 lines
fs/btrfs/ctree.h +0 -2
 	__le64 total_bytes;
 	__le64 bytes_used;
 	__le64 root_dir_objectid;
@@ -2317,8 +2317,6 @@ BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
 			 chunk_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
 			 log_root, 64);
-BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
-			 log_root_transid, 64);
 BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
 			 log_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,
#2 lore raw
Quoted 23 lines · Nikolay Borisov
Quoted 20 lines · Qu Wenruo

The member log_root_transid is never used.
It's always kept untouched even when updating log tree root.

And populating it without introducing new incompat flags could easily cause back-compatibility problems.
So just mark it unused.

---
 fs/btrfs/ctree.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/ctree.h +0 -0
index 53af9f5253f4..9adc53db679a 100644
@@ -214,8 +214,8 @@ struct btrfs_super_block {
 	__le64 chunk_root;
 	__le64 log_root;
 
Quoted 8 lines

fs/btrfs/ctree.h struct btrfs_super_block { · line 218

Quoted 4 lines
fs/btrfs/ctree.h +2 -2
-	/* this will help find the new super based on the log root */
-	__le64 log_root_transid;
+	/* This member is never touched, should always be 0 */
+	__le64 __unused_log_root_transid;

no need to be that descriptive, that's the whole idea of switching the parameter's name. Just use "reserved1" or "unused" or "padding", also the name is eloquent enough that the comment is redundant.

Indeed, that comment will be gone.

Thanks,
Qu

Quoted 14 lines
Quoted 14 lines
fs/btrfs/ctree.h +0 -2
 	__le64 total_bytes;
 	__le64 bytes_used;
 	__le64 root_dir_objectid;
@@ -2317,8 +2317,6 @@ BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
 			 chunk_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
 			 log_root, 64);
-BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
-			 log_root_transid, 64);
 BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
 			 log_root_level, 8);
 BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,