From patchwork Tue Mar 22 06:12:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8638131 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 230D39F44D for ; Tue, 22 Mar 2016 06:14:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56A8120225 for ; Tue, 22 Mar 2016 06:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 757622038A for ; Tue, 22 Mar 2016 06:14:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbcCVGOG (ORCPT ); Tue, 22 Mar 2016 02:14:06 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33909 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbcCVGNE (ORCPT ); Tue, 22 Mar 2016 02:13:04 -0400 Received: by mail-pf0-f195.google.com with SMTP id n5so33916903pfn.1; Mon, 21 Mar 2016 23:13:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VotkddvTvrfFJtAyWCWY1HyUH+HcurGAhCsUzdRX95c=; b=is1VkYZAWnO5KSe+py69tq2NMQAfts+H3CMZPSYkVLAzaStMbVLuVJICp1TOZqymRe 4jfV3W6Zfx8Q7gC+FrbRpVVEtcccgPM2Lvz53tWcMV1bfcRIMnCNlHOJUcUbW/8hvMHl TrTFnNeBBRswJyizX83kgfVwDmXB1b3KXvo1OOTWou7xPfTNPjHyXtR7EPBQzmmR5MLo cBaNrnNPXGVzFVCv+ls9uukUBxpJMwufWfT6nZCLLxnAI5nW4h3NOB3FgQmVAPuGZjFs rcsET9hqViE61xfgzWgfaNpdzWuJQLRA9mIEQ2C133T5Sd8aFH2cB4kHvogSKglTKOyC lWQg== X-Gm-Message-State: AD7BkJJpY0P24mJgvHxEphrl62xBsiKtNvS2laDgJfCQxG5qi+1cXkfXIlkCXez4dZP/Cg== X-Received: by 10.66.164.39 with SMTP id yn7mr51535676pab.107.1458627184213; Mon, 21 Mar 2016 23:13:04 -0700 (PDT) Received: from localhost ([116.251.212.171]) by smtp.gmail.com with ESMTPSA id p79sm45037010pfi.61.2016.03.21.23.13.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 21 Mar 2016 23:13:03 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Al Viro , Anton Altaparmakov , xfs@oss.sgi.com, Dave Chinner , drbd-dev@lists.linbit.com, Philipp Reisner , Lars Ellenberg , Boaz Harrosh , Ming Lei Subject: [PATCH 7/8] block: drbd: avoid to use BIO_MAX_SIZE Date: Tue, 22 Mar 2016 14:12:28 +0800 Message-Id: <1458627149-12988-8-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458627149-12988-1-git-send-email-ming.lei@canonical.com> References: <1458627149-12988-1-git-send-email-ming.lei@canonical.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drbd is the only user of BIO_MAX_SIZE, so use BIO_MAX_PAGES instead. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index c227fd4..10bfff1 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -1327,14 +1327,14 @@ struct bm_extent { #endif #endif -/* BIO_MAX_SIZE is 256 * PAGE_CACHE_SIZE, +/* Estimate max bio size as 256 * PAGE_CACHE_SIZE, * so for typical PAGE_CACHE_SIZE of 4k, that is (1<<20) Byte. * Since we may live in a mixed-platform cluster, * we limit us to a platform agnostic constant here for now. * A followup commit may allow even bigger BIO sizes, * once we thought that through. */ #define DRBD_MAX_BIO_SIZE (1U << 20) -#if DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE +#if DRBD_MAX_BIO_SIZE > (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) #error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE #endif #define DRBD_MAX_BIO_SIZE_SAFE (1U << 12) /* Works always = 4k */