From patchwork Thu Mar 16 16:12:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9628841 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 5325060244 for ; Thu, 16 Mar 2017 16:14:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45050283F9 for ; Thu, 16 Mar 2017 16:14:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3978A28489; Thu, 16 Mar 2017 16:14:31 +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=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 E1F95283F9 for ; Thu, 16 Mar 2017 16:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754843AbdCPQOY (ORCPT ); Thu, 16 Mar 2017 12:14:24 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35183 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754974AbdCPQOW (ORCPT ); Thu, 16 Mar 2017 12:14:22 -0400 Received: by mail-pg0-f65.google.com with SMTP id g2so6589224pge.2; Thu, 16 Mar 2017 09:14:21 -0700 (PDT) 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=GerF+jtUl5tKFOHgaTjxhT2LQcls+qS/xapWSkVVLTY=; b=k43K6y3Le/Y2YxGJWsOko6AXvQqQjMrHNVBnL9F6iLgVEVSA33XavXCErLDOpTCbU4 YnSM9jjDcWeGvxjnyMwPy05ZVrMhJQr1Mtocphxyb5mWWtLdnF17XL+Eagr3AT6In/tR vkIBM/LphoZ1ojtU5assPoYH11sSplQND9/yAxilgiHQCl1DJkMrvTh6J+/XVVcIHkwF kvhPJOuLfWJLCFdJ794uuN28WcabzcFf4vns/PM/FUxSNhmfcohmSQG4Q7owrwk0rOeB R/aYV1eIjFXimRAXb1SFKxsorFpF9UQAY0HfyXxZixXX+82o94jQE50ZTnEl+y1FwEQz h6pA== 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=GerF+jtUl5tKFOHgaTjxhT2LQcls+qS/xapWSkVVLTY=; b=dhIWppJsAYwVBEgFGOTSzPFyF6/rotth90EJFbjtVIR+D3N3DTuHmAihBciUCLmZVa XTpqamjDBADJY91mbqvH2i6bCoCMMoYrwf41Ra8DUnLTzCPKoleigTbtNEhSe8rQ/4OP 7bdAjodzeTN4yKFDQVM3eMBSklmAanIzJEvDVWlWM7XNDghK7GPEXWuuHoUMIsTjCdq7 6z33des0GYmz0kRmZ3grsv2HocGgf0rDh1ATCU0sw0vh4j0t6OE4vecZUcKD0xfxnxNe cuhPzNf72eQrc8TOX8FFJxaSegoBHM9hcxmy2nr5GJsnLITq9BYDUvn3vIVcIK8BvHLx ygUA== X-Gm-Message-State: AFeK/H0thOC0yBK3+/SETzK+ILTOrkjkFOeMFP3MygZu5e31+/1oqHmrk91U1OlS9bVkBg== X-Received: by 10.84.213.16 with SMTP id f16mr13498745pli.156.1489680855695; Thu, 16 Mar 2017 09:14:15 -0700 (PDT) Received: from localhost ([103.192.224.52]) by smtp.gmail.com with ESMTPSA id 129sm11547992pgj.59.2017.03.16.09.14.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Mar 2017 09:14:15 -0700 (PDT) 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 v3 02/14] md: move two macros into md.h Date: Fri, 17 Mar 2017 00:12:23 +0800 Message-Id: <20170316161235.27110-3-tom.leiming@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170316161235.27110-1-tom.leiming@gmail.com> References: <20170316161235.27110-1-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 4a0b2ad5025e..908e2caeb704 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -94,10 +94,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 b4a56a488668..2b40420299e3 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 */