All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
Subject: [PATCH v4 02/10] Btrfs: remove unnecessary code of stripe_index assignment in __btrfs_map_block
Date: Tue, 2 Dec 2014 20:39:23 +0800	[thread overview]
Message-ID: <1417523971-15553-3-git-send-email-miaox@cn.fujitsu.com> (raw)
In-Reply-To: <1417523971-15553-1-git-send-email-miaox@cn.fujitsu.com>

From: Zhao Lei <zhaolei@cn.fujitsu.com>

stripe_index's value was set again in latter line:
stripe_index = 0;

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
---
Changelog v1 -> v4:
- None.
---
 fs/btrfs/volumes.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6f80aef..eeb5b31 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5172,9 +5172,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
 
 			/* push stripe_nr back to the start of the full stripe */
 			stripe_nr = raid56_full_stripe_start;
-			do_div(stripe_nr, stripe_len);
-
-			stripe_index = do_div(stripe_nr, nr_data_stripes(map));
+			do_div(stripe_nr, stripe_len * nr_data_stripes(map));
 
 			/* RAID[56] write or recovery. Return all stripes */
 			num_stripes = map->num_stripes;
-- 
1.9.3


  parent reply	other threads:[~2014-12-02 12:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 12:39 [PATCH v4 00/10] Implement device scrub/replace for RAID56 Miao Xie
2014-12-02 12:39 ` [PATCH v4 01/10] Btrfs: remove noused bbio_ret in __btrfs_map_block in condition Miao Xie
2014-12-02 12:39 ` Miao Xie [this message]
2014-12-02 12:39 ` [PATCH v4 03/10] Btrfs, raid56: don't change bbio and raid_map Miao Xie
2014-12-02 12:39 ` [PATCH v4 04/10] Btrfs, scrub: repair the common data on RAID5/6 if it is corrupted Miao Xie
2014-12-02 12:39 ` [PATCH v4 05/10] Btrfs, raid56: use a variant to record the operation type Miao Xie
2014-12-02 12:39 ` [PATCH v4 06/10] Btrfs, raid56: support parity scrub on raid56 Miao Xie
2014-12-02 12:39 ` [PATCH v4 07/10] Btrfs, replace: write dirty pages into the replace target device Miao Xie
2014-12-02 12:39 ` [PATCH v4 08/10] Btrfs, replace: write raid56 parity " Miao Xie
2014-12-02 12:39 ` [PATCH v4 09/10] Btrfs, raid56: fix use-after-free problem in the final device replace procedure on raid56 Miao Xie
2014-12-02 12:39 ` [PATCH v4 10/10] Btrfs, replace: enable dev-replace for raid56 Miao Xie
2014-12-02 13:28 ` [PATCH v4 00/10] Implement device scrub/replace for RAID56 Chris Mason
2014-12-02 13:57   ` Wang Shilong
2014-12-03  1:19   ` Miao Xie
2014-12-03  2:29   ` Miao Xie

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=1417523971-15553-3-git-send-email-miaox@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zhaolei@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.