linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove ignore_offset argument from btrfs_find_all_roots()
Date: Fri, 23 Jul 2021 06:54:42 +0800	[thread overview]
Message-ID: <25ee7aec-a7ff-e636-634d-451cc7cf49cb@gmx.com> (raw)
In-Reply-To: <afca30fe-2027-76fe-1237-1cb433e8f3e3@gmx.com>



On 2021/7/23 上午6:53, Qu Wenruo wrote:
> 
> 
> On 2021/7/22 下午10:58, fdmanana@kernel.org wrote:
>> From: Filipe Manana <fdmanana@suse.com>
>>
>> Currently all the callers of btrfs_find_all_roots() pass a value of false
>> for its ignore_offset argument. This makes the argument pointless and we
>> can remove it and make btrfs_find_all_roots() always pass false as the
>> ignore_offset argument for btrfs_find_all_roots_safe(). So just do that.
> 
> I thought we have some user space tool like "btrfs ins logical-resolve"
> needs the option for its "-o" option.
> 
> Did I miss something? Or is there some recent change removed that support?

My bad, just saw the reply from David.

Then it looks completely fine to me.

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> 
> Thanks,
> Qu
>>
>> Signed-off-by: Filipe Manana <fdmanana@suse.com>
>> ---
>>   fs/btrfs/backref.c            |  4 ++--
>>   fs/btrfs/backref.h            |  2 +-
>>   fs/btrfs/qgroup.c             |  8 ++++----
>>   fs/btrfs/tests/qgroup-tests.c | 20 ++++++++++----------
>>   4 files changed, 17 insertions(+), 17 deletions(-)
>>
>> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
>> index 78b202d198b8..4f64c366f369 100644
>> --- a/fs/btrfs/backref.c
>> +++ b/fs/btrfs/backref.c
>> @@ -1488,14 +1488,14 @@ static int btrfs_find_all_roots_safe(struct 
>> btrfs_trans_handle *trans,
>>   int btrfs_find_all_roots(struct btrfs_trans_handle *trans,
>>                struct btrfs_fs_info *fs_info, u64 bytenr,
>>                u64 time_seq, struct ulist **roots,
>> -             bool ignore_offset, bool skip_commit_root_sem)
>> +             bool skip_commit_root_sem)
>>   {
>>       int ret;
>>
>>       if (!trans && !skip_commit_root_sem)
>>           down_read(&fs_info->commit_root_sem);
>>       ret = btrfs_find_all_roots_safe(trans, fs_info, bytenr,
>> -                    time_seq, roots, ignore_offset);
>> +                    time_seq, roots, false);
>>       if (!trans && !skip_commit_root_sem)
>>           up_read(&fs_info->commit_root_sem);
>>       return ret;
>> diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
>> index ff5f07f9940b..ba454032dbe2 100644
>> --- a/fs/btrfs/backref.h
>> +++ b/fs/btrfs/backref.h
>> @@ -47,7 +47,7 @@ int btrfs_find_all_leafs(struct btrfs_trans_handle 
>> *trans,
>>                const u64 *extent_item_pos, bool ignore_offset);
>>   int btrfs_find_all_roots(struct btrfs_trans_handle *trans,
>>                struct btrfs_fs_info *fs_info, u64 bytenr,
>> -             u64 time_seq, struct ulist **roots, bool ignore_offset,
>> +             u64 time_seq, struct ulist **roots,
>>                bool skip_commit_root_sem);
>>   char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct 
>> btrfs_path *path,
>>               u32 name_len, unsigned long name_off,
>> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
>> index 0fa121171ca1..db680f5be745 100644
>> --- a/fs/btrfs/qgroup.c
>> +++ b/fs/btrfs/qgroup.c
>> @@ -1733,7 +1733,7 @@ int btrfs_qgroup_trace_extent_post(struct 
>> btrfs_trans_handle *trans,
>>       ASSERT(trans != NULL);
>>
>>       ret = btrfs_find_all_roots(NULL, trans->fs_info, bytenr, 0, 
>> &old_root,
>> -                   false, true);
>> +                   true);
>>       if (ret < 0) {
>>           trans->fs_info->qgroup_flags |= 
>> BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
>>           btrfs_warn(trans->fs_info,
>> @@ -2651,7 +2651,7 @@ int btrfs_qgroup_account_extents(struct 
>> btrfs_trans_handle *trans)
>>                   /* Search commit root to find old_roots */
>>                   ret = btrfs_find_all_roots(NULL, fs_info,
>>                           record->bytenr, 0,
>> -                        &record->old_roots, false, false);
>> +                        &record->old_roots, false);
>>                   if (ret < 0)
>>                       goto cleanup;
>>               }
>> @@ -2667,7 +2667,7 @@ int btrfs_qgroup_account_extents(struct 
>> btrfs_trans_handle *trans)
>>                * current root. It's safe inside commit_transaction().
>>                */
>>               ret = btrfs_find_all_roots(trans, fs_info,
>> -               record->bytenr, BTRFS_SEQ_LAST, &new_roots, false, 
>> false);
>> +               record->bytenr, BTRFS_SEQ_LAST, &new_roots, false);
>>               if (ret < 0)
>>                   goto cleanup;
>>               if (qgroup_to_skip) {
>> @@ -3201,7 +3201,7 @@ static int qgroup_rescan_leaf(struct 
>> btrfs_trans_handle *trans,
>>               num_bytes = found.offset;
>>
>>           ret = btrfs_find_all_roots(NULL, fs_info, found.objectid, 0,
>> -                       &roots, false, false);
>> +                       &roots, false);
>>           if (ret < 0)
>>               goto out;
>>           /* For rescan, just pass old_roots as NULL */
>> diff --git a/fs/btrfs/tests/qgroup-tests.c 
>> b/fs/btrfs/tests/qgroup-tests.c
>> index 98b5aaba46f1..f3137285a9e2 100644
>> --- a/fs/btrfs/tests/qgroup-tests.c
>> +++ b/fs/btrfs/tests/qgroup-tests.c
>> @@ -224,7 +224,7 @@ static int test_no_shared_qgroup(struct btrfs_root 
>> *root,
>>        * quota.
>>        */
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &old_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           test_err("couldn't find old roots: %d", ret);
>> @@ -237,7 +237,7 @@ static int test_no_shared_qgroup(struct btrfs_root 
>> *root,
>>           return ret;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &new_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           ulist_free(new_roots);
>> @@ -261,7 +261,7 @@ static int test_no_shared_qgroup(struct btrfs_root 
>> *root,
>>       new_roots = NULL;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &old_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           test_err("couldn't find old roots: %d", ret);
>> @@ -273,7 +273,7 @@ static int test_no_shared_qgroup(struct btrfs_root 
>> *root,
>>           return -EINVAL;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &new_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           ulist_free(new_roots);
>> @@ -325,7 +325,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>       }
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &old_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           test_err("couldn't find old roots: %d", ret);
>> @@ -338,7 +338,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>           return ret;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &new_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           ulist_free(new_roots);
>> @@ -360,7 +360,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>       }
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &old_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           test_err("couldn't find old roots: %d", ret);
>> @@ -373,7 +373,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>           return ret;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &new_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           ulist_free(new_roots);
>> @@ -401,7 +401,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>       }
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &old_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           test_err("couldn't find old roots: %d", ret);
>> @@ -414,7 +414,7 @@ static int test_multiple_refs(struct btrfs_root 
>> *root,
>>           return ret;
>>
>>       ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, 
>> &new_roots,
>> -            false, false);
>> +            false);
>>       if (ret) {
>>           ulist_free(old_roots);
>>           ulist_free(new_roots);
>>

      reply	other threads:[~2021-07-22 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 14:58 [PATCH] btrfs: remove ignore_offset argument from btrfs_find_all_roots() fdmanana
2021-07-22 16:04 ` David Sterba
2021-07-22 22:53 ` Qu Wenruo
2021-07-22 22:54   ` Qu Wenruo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25ee7aec-a7ff-e636-634d-451cc7cf49cb@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).