linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] md: Simplify code with existing definition RESYNC_SECTORS in raid10.c
@ 2020-08-21  1:29 Zhen Lei
  2020-08-21  5:05 ` Song Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2020-08-21  1:29 UTC (permalink / raw)
  To: Song Liu, linux-raid, linux-kernel; +Cc: Zhen Lei

#define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)

"RESYNC_BLOCK_SIZE/512" is equal to "RESYNC_BLOCK_SIZE >> 9", replace it
with RESYNC_SECTORS.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/md/raid10.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index e8fa327339171c7..da12e3daf6fa8d9 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4466,8 +4466,8 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
 		last = conf->reshape_progress - 1;
 		sector_nr = last & ~(sector_t)(conf->geo.chunk_mask
 					       & conf->prev.chunk_mask);
-		if (sector_nr + RESYNC_BLOCK_SIZE/512 < last)
-			sector_nr = last + 1 - RESYNC_BLOCK_SIZE/512;
+		if (sector_nr + RESYNC_SECTORS < last)
+			sector_nr = last + 1 - RESYNC_SECTORS;
 	} else {
 		/* 'next' is after the last device address that we
 		 * might write to for this chunk in the new layout
@@ -4489,8 +4489,8 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
 		last  = sector_nr | (conf->geo.chunk_mask
 				     & conf->prev.chunk_mask);
 
-		if (sector_nr + RESYNC_BLOCK_SIZE/512 <= last)
-			last = sector_nr + RESYNC_BLOCK_SIZE/512 - 1;
+		if (sector_nr + RESYNC_SECTORS <= last)
+			last = sector_nr + RESYNC_SECTORS - 1;
 	}
 
 	if (need_flush ||
-- 
1.8.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] md: Simplify code with existing definition RESYNC_SECTORS in raid10.c
  2020-08-21  1:29 [PATCH 1/1] md: Simplify code with existing definition RESYNC_SECTORS in raid10.c Zhen Lei
@ 2020-08-21  5:05 ` Song Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Song Liu @ 2020-08-21  5:05 UTC (permalink / raw)
  To: Zhen Lei; +Cc: linux-raid, linux-kernel

On Thu, Aug 20, 2020 at 6:29 PM Zhen Lei <thunder.leizhen@huawei.com> wrote:
>
> #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
>
> "RESYNC_BLOCK_SIZE/512" is equal to "RESYNC_BLOCK_SIZE >> 9", replace it
> with RESYNC_SECTORS.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Applied to md-next. Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-21  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21  1:29 [PATCH 1/1] md: Simplify code with existing definition RESYNC_SECTORS in raid10.c Zhen Lei
2020-08-21  5:05 ` Song Liu

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).