From patchwork Tue Feb 28 15:41:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9596065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F6C9601D7 for ; Tue, 28 Feb 2017 15:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0031628535 for ; Tue, 28 Feb 2017 15:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E90332853A; Tue, 28 Feb 2017 15:42:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F9C428535 for ; Tue, 28 Feb 2017 15:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbdB1PmY (ORCPT ); Tue, 28 Feb 2017 10:42:24 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34484 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbdB1PmU (ORCPT ); Tue, 28 Feb 2017 10:42:20 -0500 Received: by mail-pg0-f68.google.com with SMTP id s67so1990230pgb.1; Tue, 28 Feb 2017 07:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T4vr6MJB1ZVnTu+2aTT0ixZWbzRTcou3hlYA12I4Qh4=; b=EeRpsQsvyweFnLgy2nMAHdQa4wnbCg/YSgb4mi9Jr8KM1n0OcW4AZcFtD0RiZp9yuc rTaWKEUujZxuTxfcQV4sBK7SyFGyvz79VKZMsbnalaQUrZLQRSnuhBPyd3PpiCltDvJ6 Md3WYfEtEURMX1t24NxnTEFumYkv4St5k8U+dz05PiNxBDq5CYjsLOAo2tw1QofKLDhU twRRSwXXuxZPGeJ/0bqGO6b47ij7MrAsOwpLSlaXEkGHiCxP4sY8+O9UBnpkWtPoDcEB KDNlbviCYgJYKfcg50TZ84rg993HoygBQRAk1yYPXHk7lqVwNvy7xKdaqCFQqffYAJDX rD3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T4vr6MJB1ZVnTu+2aTT0ixZWbzRTcou3hlYA12I4Qh4=; b=Ew6UL9bqyxpGi7sUQIWsLlpna7BSLvXZVJMsxPROcxT1/UzxrkBaTMAjrUkBNffrJt dSQg1mPDJ/rrv1pwOj2F1UcDwWGSt24xKRzvZG/oMrCR8NL6X0i5susDWr/i07I1hpgF pfaLkVM3+1a/h5YBbXg1pYWRFYbY174wpBwJvxKeMff6sxpGV4s2VXfFZcSQz2AR018I OgW2LqeyHBhEKxqfUZx/DZBqJO4x+bIKekJxrIkSQffr1pei0hxM4uRlP9ss7W5FL2D4 /C9wn8ohmtqGENbOGvvzRIrkJNzbCdmkxzFpkR9y+c+IJUVkjxzgpWwuTFQr0bwCybUe i4ow== X-Gm-Message-State: AMke39kftlhQhg/thxQM4GIGnPitkgWZF37Rw9ULbhcKMoBpPqbdtnS8sgdRW91nq7V+QQ== X-Received: by 10.84.231.200 with SMTP id g8mr3891183pln.100.1488296533987; Tue, 28 Feb 2017 07:42:13 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id h14sm5089185pgn.41.2017.02.28.07.42.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 07:42:13 -0800 (PST) From: Ming Lei To: Shaohua Li , Jens Axboe , linux-raid@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig Cc: Ming Lei Subject: [PATCH v2 03/13] md: move two macros into md.h Date: Tue, 28 Feb 2017 23:41:33 +0800 Message-Id: <1488296503-4987-4-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488296503-4987-1-git-send-email-tom.leiming@gmail.com> References: <1488296503-4987-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both raid1 and raid10 share common resync block size and page count, so move them into md.h. Signed-off-by: Ming Lei --- drivers/md/md.h | 5 +++++ drivers/md/raid1.c | 2 -- drivers/md/raid10.c | 3 --- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/md/md.h b/drivers/md/md.h index b8859cbf84b6..1d63239a1be4 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -715,4 +715,9 @@ static inline void mddev_check_writesame(struct mddev *mddev, struct bio *bio) !bdev_get_queue(bio->bi_bdev)->limits.max_write_same_sectors) mddev->queue->limits.max_write_same_sectors = 0; } + +/* Maximum size of each resync request */ +#define RESYNC_BLOCK_SIZE (64*1024) +#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) + #endif /* _MD_MD_H */ diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index b3021355c7e2..25c9172db639 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -91,10 +91,8 @@ static void r1bio_pool_free(void *r1_bio, void *data) kfree(r1_bio); } -#define RESYNC_BLOCK_SIZE (64*1024) #define RESYNC_DEPTH 32 #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9) -#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) #define RESYNC_WINDOW (RESYNC_BLOCK_SIZE * RESYNC_DEPTH) #define RESYNC_WINDOW_SECTORS (RESYNC_WINDOW >> 9) #define CLUSTER_RESYNC_WINDOW (16 * RESYNC_WINDOW) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ceb3acc793cf..c5f1a117494b 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -125,9 +125,6 @@ static void r10bio_pool_free(void *r10_bio, void *data) kfree(r10_bio); } -/* Maximum size of each resync request */ -#define RESYNC_BLOCK_SIZE (64*1024) -#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) /* amount of memory to reserve for resync requests */ #define RESYNC_WINDOW (1024*1024) /* maximum number of concurrent requests, memory permitting */