Skip to content

Commit 97f09d5

Browse files
adam900710kdave
authored andcommitted
btrfs: make btrfs_super_block::log_root_transid deprecated
When using "btrfs inspect-internal dump-super" to inspect an fs with dirty log, it always shows the log_root_transid as 0: log_root 30474240 log_root_transid 0 <<< log_root_level 0 It turns out that, btrfs_super_block::log_root_transid is never really utilized (even no read for it). This can date back to the introduction of btrfs into upstream kernel. In fact, when reading log tree root, we always use btrfs_super_block::generation + 1 as the expected generation. So here we're completely safe to mark this member deprecated. In theory we can easily reuse this member for other purposes, but to be extra safe, here we follow the leafsize way, by adding "__unused_" for log_root_transid. And we can safely remove the accessors, since there is no such callers from the very beginning. Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 722c82a commit 97f09d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/btrfs/ctree.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,12 @@ struct btrfs_super_block {
248248
__le64 chunk_root;
249249
__le64 log_root;
250250

251-
/* this will help find the new super based on the log root */
252-
__le64 log_root_transid;
251+
/*
252+
* This member has never been utilized since the very beginning, thus
253+
* it's always 0 regardless of kernel version. We always use
254+
* generation + 1 to read log tree root. So here we mark it deprecated.
255+
*/
256+
__le64 __unused_log_root_transid;
253257
__le64 total_bytes;
254258
__le64 bytes_used;
255259
__le64 root_dir_objectid;
@@ -2475,8 +2479,6 @@ BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
24752479
chunk_root_level, 8);
24762480
BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
24772481
log_root, 64);
2478-
BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
2479-
log_root_transid, 64);
24802482
BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
24812483
log_root_level, 8);
24822484
BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,

0 commit comments

Comments
 (0)