linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/6] btrfs: Read stripe len directly in btrfs_rmap_block
Date: Wed, 15 Jan 2020 12:52:12 +0200	[thread overview]
Message-ID: <00859c46-cbdd-19f8-b57c-18e7670afa3c@suse.com> (raw)
In-Reply-To: <20200114165411.GG3929@twin.jikos.cz>



On 14.01.20 г. 18:54 ч., David Sterba wrote:
> On Tue, Nov 19, 2019 at 02:05:54PM +0200, Nikolay Borisov wrote:
>> extent_map::orig_block_len contains the size of a physical stripe when
>> it's used to describe block groups. So get the size directly in
>> btrfs_rmap_block rather than open-coding the calculations. No
>> functional changes.
>>
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
>> ---
>>  fs/btrfs/block-group.c | 11 +++--------
>>  1 file changed, 3 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
>> index c3b1f304bc70..2ab4d9cb598a 100644
>> --- a/fs/btrfs/block-group.c
>> +++ b/fs/btrfs/block-group.c
>> @@ -1546,17 +1546,12 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
>>  		return -EIO;
>>  
>>  	map = em->map_lookup;
>> -	data_stripe_length = em->len;
>> +	data_stripe_length = em->orig_block_len;
>>  	io_stripe_size = map->stripe_len;
>>  
>> -	if (map->type & BTRFS_BLOCK_GROUP_RAID10)
>> -		data_stripe_length = div_u64(data_stripe_length, map->num_stripes / map->sub_stripes);
>> -	else if (map->type & BTRFS_BLOCK_GROUP_RAID0)
>> -		data_stripe_length = div_u64(data_stripe_length, map->num_stripes);
>> -	else if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
>> -		data_stripe_length = div_u64(data_stripe_length, nr_data_stripes(map));
>> +	/* For raid5/6 adjust to a full IO stripe length */
>> +	if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
>>  		io_stripe_size = map->stripe_len * nr_data_stripes(map);
> 
> I'm not convinced this is 'no functional change' so will merge only
> patches 1-4 for now as I have reviewed them and want to add them to
> misc-next before the 5.6 freeze.
> 

THe easiest way to convince yourself is to work out the maths happening
in __btrfs_alloc_chunk, since orig_block_len for chunks is set there.



  reply	other threads:[~2020-01-15 10:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 12:05 [PATCH 0/6] Cleanup super block stripe exclusion code Nikolay Borisov
2019-11-19 12:05 ` [PATCH 1/6] btrfs: Move and unexport btrfs_rmap_block Nikolay Borisov
2019-11-26 15:53   ` David Sterba
2019-12-10 17:57     ` [PATCH v2] " Nikolay Borisov
2020-01-02 15:21       ` David Sterba
2019-11-19 12:05 ` [PATCH 2/6] btrfs: selftests: Add support for dummy devices Nikolay Borisov
2019-11-19 12:05 ` [PATCH 3/6] btrfs: Add self-tests for btrfs_rmap_block Nikolay Borisov
2019-11-26 16:04   ` David Sterba
2019-12-10 18:00     ` [PATCH v2] " Nikolay Borisov
2020-01-02 15:40       ` David Sterba
2020-01-10 14:46         ` Nikolay Borisov
2020-01-14 16:51           ` David Sterba
2019-11-19 12:05 ` [PATCH 4/6] btrfs: Refactor btrfs_rmap_block to improve readability Nikolay Borisov
2019-11-19 12:05 ` [PATCH 5/6] btrfs: Read stripe len directly in btrfs_rmap_block Nikolay Borisov
2020-01-14 16:54   ` David Sterba
2020-01-15 10:52     ` Nikolay Borisov [this message]
2019-11-19 12:05 ` [PATCH 6/6] btrfs: Remove dead code exclude_super_stripes Nikolay Borisov

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=00859c46-cbdd-19f8-b57c-18e7670afa3c@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.cz \
    --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).