From patchwork Wed Mar 30 16:17:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8699641 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 C0A859F39A for ; Wed, 30 Mar 2016 16:18:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E48D420384 for ; Wed, 30 Mar 2016 16:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 147C32013D for ; Wed, 30 Mar 2016 16:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932712AbcC3QSA (ORCPT ); Wed, 30 Mar 2016 12:18:00 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35116 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbcC3QR5 (ORCPT ); Wed, 30 Mar 2016 12:17:57 -0400 Received: by mail-pf0-f194.google.com with SMTP id t66so4198749pfb.2; Wed, 30 Mar 2016 09:17:57 -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=f8RnSXiS0Ltm1s1Wqzt4C04rE3FJ1OU0KmBxRNLnWV4=; b=AVkEK99m67pcCQIfI5yxBKJDKSbbIj9ggpB877wGaAAtZ8MhXMDGQAsD29a+rxXPSr mwE1bfqlgYLpf6KBrZLHKK8q+JSbfzYMXeTS9ZrTz1UXvb0DPY1GVhYKbOLUilPiVhTw Klwj71NWFOtlL3RznQaj6Z8ID+LFT3C5ybyzW4itBpckjiux7GRO9YxLuI93LbrBlljP AdedoIE7BJx/MtfGsnhwCcw0mnhJ5Gze4/J8gD1xKcptymhSIFsWsb4fV4vkaFE+vjYA lXOlUs3y4OX6SIuehJFf6eJWG4KVWEo1hHnhkihk/NwY56rR1Kat/KqSDw3LuUUP6oXq kDEQ== X-Gm-Message-State: AD7BkJIAZ8jX6x0VCvzqhnLXBy9VrLEHN3Qn8vMv5xWIXAXVEFtCnSTycaPvsmGct8g1/Q== X-Received: by 10.98.71.203 with SMTP id p72mr14552935pfi.165.1459354676704; Wed, 30 Mar 2016 09:17:56 -0700 (PDT) Received: from localhost (45-125-195-13.ip4.readyserver.sg. [45.125.195.13]) by smtp.gmail.com with ESMTPSA id ux2sm7018063pac.46.2016.03.30.09.17.55 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 30 Mar 2016 09:17:56 -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 v1 7/8] block: drbd: avoid to use BIO_MAX_SIZE Date: Thu, 31 Mar 2016 00:17:16 +0800 Message-Id: <1459354637-17415-8-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459354637-17415-1-git-send-email-ming.lei@canonical.com> References: <1459354637-17415-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=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SBL, 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. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- 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 */