2017-09-12 19:21 GMT+03:00 Timofey Titovets <nefelim4ag@xxxxxxxxx>:
> 2017-09-12 0:12 GMT+03:00 <josef@xxxxxxxxxxxxxx>:
>> From: Josef Bacik <jbacik@xxxxxx>
>>
>> Because seriously? ref2 and then ref1?
>>
>> Signed-off-by: Josef Bacik <jbacik@xxxxxx>
>> ---
>> fs/btrfs/delayed-ref.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
>> index 7374710..c5de6c7 100644
>> --- a/fs/btrfs/delayed-ref.c
>> +++ b/fs/btrfs/delayed-ref.c
>> @@ -40,8 +40,8 @@ struct kmem_cache *btrfs_delayed_extent_op_cachep;
>> /*
>> * compare two delayed tree backrefs with same bytenr and type
>> */
>> -static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2,
>> - struct btrfs_delayed_tree_ref *ref1)
>> +static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref1,
>> + struct btrfs_delayed_tree_ref *ref2)
>> {
>> if (ref1->node.type == BTRFS_TREE_BLOCK_REF_KEY) {
>> if (ref1->root < ref2->root)
>> @@ -60,8 +60,8 @@ static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2,
>> /*
>> * compare two delayed data backrefs with same bytenr and type
>> */
>> -static int comp_data_refs(struct btrfs_delayed_data_ref *ref2,
>> - struct btrfs_delayed_data_ref *ref1)
>> +static int comp_data_refs(struct btrfs_delayed_data_ref *ref1,
>> + struct btrfs_delayed_data_ref *ref2)
>> {
>> if (ref1->node.type == BTRFS_EXTENT_DATA_REF_KEY) {
>> if (ref1->root < ref2->root)
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Result of that function does not used anywhere (i.e. only as bool),
> may be let's rename that like:
> compr_tree_refs_eq()
> and simplify to
> if (ref1->root != ref2->root)
> return 0;
>
> (same for comp_data_refs())
>
> This can made that more obvious and remove useless if. as that not
> used in any "sorting" code
>
> Thanks.
>
> Reviewed-by: Timofey Titovets <nefelim4ag@xxxxxxxxx>
>
> --
> Have a nice day,
> Timofey.
Oh, sorry, you want convert list to RB tree, so result will be used.
Just ignore my comment.
--
Have a nice day,
Timofey.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html