From patchwork Fri Feb 24 15:42:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9590605 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 E90FE6020A for ; Fri, 24 Feb 2017 15:48:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD17022BF1 for ; Fri, 24 Feb 2017 15:48:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1DBA286CC; Fri, 24 Feb 2017 15:48:28 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 90EFD22BF1 for ; Fri, 24 Feb 2017 15:48:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbdBXPoN (ORCPT ); Fri, 24 Feb 2017 10:44:13 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33017 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751364AbdBXPnZ (ORCPT ); Fri, 24 Feb 2017 10:43:25 -0500 Received: by mail-pg0-f66.google.com with SMTP id 5so3465920pgj.0; Fri, 24 Feb 2017 07:43:25 -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=CpM80GoB5SRndB/b3JvINcQrAzSSYxVAlIsVXUneII4=; b=PEnFKFpQoyW9BsKM5sUM7fp/Kgl26a3vABSc1xd+2hLX/CtT6HuWG0mG5WUgq52950 jw8wAMhC4TbsIOcGFWafz2byqlJshHxR3B0LVOkRvofhpJ6rJTn49uHUYQEFz5SYdLEW nXhnfl86Adc8wITHd/ngZqjaMQ/aTmnbqGB+KBK7Xw96ZGsGmPHXnRjvn9ddeAOySUk8 IT0QoqvxdV81RK9fO1tTlseaQPtcV4iUrpR/rK88PpmrCF9jEd8XJWiVe1SFzdD1XuDH FGI+1CLn5VDENlZ0FYEJ3TLLnbhyyvWKQLnF9Gdv+B989MjqJgJ7YTxjFlM7c/IMAoDj 9/tw== 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=CpM80GoB5SRndB/b3JvINcQrAzSSYxVAlIsVXUneII4=; b=feq2pv3KhMM3p7ALcM3VxmHpGjMhUF6x682gwaEQ8WTNOtFYAalagrCGXl9ElMQ/H4 BYl9isnfzihxS8I1CHrqw2LDSKLJJo12362Mrb2zccEORjQGDAdOuf5DZxu0Ylc2EKmt g72Xq2f3zHVFFLpuGYrSIc+VFCfQP7sDmF1iurD1VjTyKDAkkaLNU56r52Tn2Yqi2+1e ZqABb3ljUJuyb5vW4QSFtM1f9DPMtWAemZDqrwZOD142VfpMc9eFA0a3IzAHtkxfHTjd ZAhYUfQLTSGaIXHr1R54dW/qOEoEQgIL+C8O/O87FPTIiRE2byIG6GmMNgdknoz9m5ap dN9w== X-Gm-Message-State: AMke39l5NchIAyjm6SPVUXyvnDMHFlEwC+Qs6OuCW4ENQATl092G5iR/E1SHJZ/qicuZgg== X-Received: by 10.84.168.131 with SMTP id f3mr4687716plb.163.1487951004949; Fri, 24 Feb 2017 07:43:24 -0800 (PST) Received: from localhost (li405-222.members.linode.com. [106.187.53.222]) by smtp.gmail.com with ESMTPSA id l71sm15969698pga.32.2017.02.24.07.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 07:43:24 -0800 (PST) From: Ming Lei To: Shaohua Li , Jens Axboe , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig Cc: Ming Lei Subject: [PATCH v1 04/14] md: move two macros into md.h Date: Fri, 24 Feb 2017 23:42:41 +0800 Message-Id: <1487950971-1131-5-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487950971-1131-1-git-send-email-tom.leiming@gmail.com> References: <1487950971-1131-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 2a0bf5b430c9..2013e5870761 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 125d74dba27e..227dd6ad7716 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 */