Re: [PATCH 2/2] btrfs-progs: Deprecate unused super block member log_root_transid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2018/10/12 下午5:13, Nikolay Borisov wrote:
> 
> 
> On 12.10.2018 11:46, Qu Wenruo wrote:
>>
>>
>> On 2018/10/12 下午2:53, Nikolay Borisov wrote:
>>>
>>>
>>> On 12.10.2018 09:42, Qu Wenruo wrote:
>>>> The only user of it is "btrfs inspect dump-super".
>>>>
>>>> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
>>>> ---
>>>>  cmds-inspect-dump-super.c | 4 ++--
>>>>  ctree.h                   | 6 ++----
>>>>  2 files changed, 4 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c
>>>> index e965267c5d96..3f33931ed9bc 100644
>>>> --- a/cmds-inspect-dump-super.c
>>>> +++ b/cmds-inspect-dump-super.c
>>>> @@ -387,8 +387,8 @@ static void dump_superblock(struct btrfs_super_block *sb, int full)
>>>>  	       (unsigned long long)btrfs_super_chunk_root_level(sb));
>>>>  	printf("log_root\t\t%llu\n",
>>>>  	       (unsigned long long)btrfs_super_log_root(sb));
>>>> -	printf("log_root_transid\t%llu\n",
>>>> -	       (unsigned long long)btrfs_super_log_root_transid(sb));
>>>> +	printf("log_root_transid (deprecated)\t%llu\n",
>>>> +	       le64_to_cpu(sb->__unused_log_root_transid));
>>>
>>> This should be entirely removed.
>>
>> It looks OK to me.
>> Just like the old leafsize.
>>
>> And if we try to use this member again, even old progs could show it
>> without problem.
> 
> But what is the point of having something which always shows 0 and is
> essentially unused?

Personally speaking, even it's in fact never used, it is still part of
the specification of btrfs super blocks.

Even it's a bad decision we made a long time ago, we still need to mark
it as unused, other than converting it back to "reserved".

To make it short and clear, if some member is specified in early
specification, even it's never used, we still need to mark it unused and
keep part of naming.

Thanks,
Qu

> 
>>
>> Thanks,
>> Qu
>>
>>>
>>>>  	printf("log_root_level\t\t%llu\n",
>>>>  	       (unsigned long long)btrfs_super_log_root_level(sb));
>>>>  	printf("total_bytes\t\t%llu\n",
>>>> diff --git a/ctree.h b/ctree.h
>>>> index 4719962df67d..a314fdb102b0 100644
>>>> --- a/ctree.h
>>>> +++ b/ctree.h
>>>> @@ -427,8 +427,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;
>>>> @@ -2203,8 +2203,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,
>>>>
>>



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux