From patchwork Mon May 30 13:34:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9141507 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 D6ECE60777 for ; Mon, 30 May 2016 13:40:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C91D227E15 for ; Mon, 30 May 2016 13:40:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB52028188; Mon, 30 May 2016 13:40:05 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 5287227E15 for ; Mon, 30 May 2016 13:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161204AbcE3Ngs (ORCPT ); Mon, 30 May 2016 09:36:48 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34233 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161537AbcE3Ngq (ORCPT ); Mon, 30 May 2016 09:36:46 -0400 Received: by mail-pf0-f196.google.com with SMTP id c84so14842282pfc.1; Mon, 30 May 2016 06:36:46 -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=7DDIqNo3Ku+JnxIHsS8jo0k97hygapzQb4NM1SJxbT0=; b=ji9RyBgqFVIpeXT7GBxnxNoAjndRf8C5YaAXlHlHSGzFty7dF1ia/g7QRfCU/GoWKD TSfObgpyfzZDCzWcy7zwAqcdsYmFK5JkuqJvVJ/4BUfS099B9ErIm7+VOsmGiNAzySEz Q1d7HIO+Gst+q8QueWiJoybrB0/HlAlMTqb1SihYdEX5zIQeTCDhBccDaHC/huH/xs4w Ru2W5hKalr5WYzUL1gz0QNTEql7Bk5l4ijGKnHeix4USqcSfUUIBWa3ELzhj+s08O8Aj QYWqxgq+/0OEOMuXU8aF5/Npdkq80L/hE1104gNhtLFN8MghWsVmCGL9B2pUB/wwDu0p dh6w== X-Gm-Message-State: ALyK8tI8Z+Df7VojJ7e17kKyYzof6b3Ep8zA0O4iv8RAbnUAgCUYPuqB3bnbsZqNoOn/8w== X-Received: by 10.98.91.195 with SMTP id p186mr45102009pfb.81.1464615405583; Mon, 30 May 2016 06:36:45 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id fn3sm47796967pab.20.2016.05.30.06.36.44 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 30 May 2016 06:36:44 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com (open list:DRBD DRIVER) Subject: [PATCH v6 7/8] block: drbd: avoid to use BIO_MAX_SIZE Date: Mon, 30 May 2016 21:34:35 +0800 Message-Id: <1464615294-9946-8-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464615294-9946-1-git-send-email-ming.lei@canonical.com> References: <1464615294-9946-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-Virus-Scanned: ClamAV using ClamSMTP Use BIO_MAX_PAGES instead and we will remove BIO_MAX_SIZE. 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 */