From patchwork Sun Apr 17 21:29:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8863781 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 EDF819F441 for ; Sun, 17 Apr 2016 21:32:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D685320145 for ; Sun, 17 Apr 2016 21:31:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5D9B201C0 for ; Sun, 17 Apr 2016 21:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbcDQVbQ (ORCPT ); Sun, 17 Apr 2016 17:31:16 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:36417 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751721AbcDQVbP (ORCPT ); Sun, 17 Apr 2016 17:31:15 -0400 Received: by mail-yw0-f196.google.com with SMTP id u62so2426469ywe.3; Sun, 17 Apr 2016 14:31:15 -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=o5a4nQJYJla8Ewz2tq9Wv8RvSbpo5oKHVJQa30rM4qw=; b=J/BPoxZDRV1qTawYtdV0rdHxoJq6IFLGhlo2GdFizRa0xKlNuupSti/YUORpDzTS2I kTHKkqiYt0wrREsi4OwpWc/Q/mm8hZUBhZontRWHbqdd6OPDjPdwH397sR1ZmG1/RmP0 2ok1Fb9FluoyP5hx5DgdKTW8xqC0WXOB9PXuOGw43nU7oa2GG/RDkIBVI9KE4YKg2nWo LOH/gHtbVz1WK39c9v7kLN8sPbBLvuINbE1SF+rM/QCOEA//eh49FwKwsylIdv8xnGix rQ3j4cvWsOoisGKWZEOgJDVBZYOyMJUGxBCZkyIiPPqBmFZDcMd/9FNXGAYGeh4csaDk /5QA== X-Gm-Message-State: AOPr4FVzvO9IXdotOp7pU0rr+qw3ZopkgmcYqJogg4OZEOf+fKtg1aNm4Pn5sCbEkHZk0w== X-Received: by 10.13.223.215 with SMTP id i206mr17600011ywe.144.1460928674764; Sun, 17 Apr 2016 14:31:14 -0700 (PDT) Received: from localhost ([107.13.171.182]) by smtp.gmail.com with ESMTPSA id d193sm34034029ywe.53.2016.04.17.14.31.14 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 17 Apr 2016 14:31:14 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Al Viro , Ming Lei , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com (open list:DRBD DRIVER) Subject: [PATCH v5 7/8] block: drbd: avoid to use BIO_MAX_SIZE Date: Mon, 18 Apr 2016 05:29:56 +0800 Message-Id: <1460928615-20894-8-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460928615-20894-1-git-send-email-ming.lei@canonical.com> References: <1460928615-20894-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.5 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI, 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 7a1cf7e..e6e4b08 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_SIZE, +/* Estimate max bio size as 256 * PAGE_SIZE, * so for typical PAGE_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_SHIFT) #error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE #endif #define DRBD_MAX_BIO_SIZE_SAFE (1U << 12) /* Works always = 4k */