From patchwork Mon Apr 4 06:56:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8737901 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D550CC0553 for ; Mon, 4 Apr 2016 06:58:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7557201BB for ; Mon, 4 Apr 2016 06:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8DE1200DB for ; Mon, 4 Apr 2016 06:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932180AbcDDG5Q (ORCPT ); Mon, 4 Apr 2016 02:57:16 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:32831 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbcDDG5O (ORCPT ); Mon, 4 Apr 2016 02:57:14 -0400 Received: by mail-pf0-f170.google.com with SMTP id 184so38029877pff.0; Sun, 03 Apr 2016 23:57:13 -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=xXUdvjLtowonlrbju5ek6j4VIGdC6GChTRig76zBevk=; b=M+44p3yIK17vbYgBk8Qe3Zk/36LyutNAN/39PzghHGUFINA6wjML9TlFsYGwsJC705 58WuH26HnaJmu1dS2lwl4EttsDpm7iLpxw531zlOgbmq2OZ0UUL72Q5uxgKnTQhV0XEn avXN4PJhopPjmEiybXGcbxf5fONSIIe/kN0+3L2LWdvtJUOAt9LvODbRVEb2ENFpU6ya HpuOJA+8kXRT+QKOClwJP1PMzaC3PXoEYJXXX+D5LSbSOLvkYlit5cnmptO6qxRJGYO/ P5svKucDShEdwVe49PXRKKj6wXEMOXdTzsKQcJ+gLX17RUCRN+Y54ZhfGJCCeK9DuYFM ZSaQ== X-Gm-Message-State: AD7BkJJGx+glNCqiioT2RQSxsRaqdIFaR3NKpZuaihrqN5ciSWUC82ShE390nj2FkbWekQ== X-Received: by 10.98.32.23 with SMTP id g23mr18316906pfg.74.1459753028484; Sun, 03 Apr 2016 23:57:08 -0700 (PDT) Received: from localhost (45-125-195-13.ip4.readyserver.sg. [45.125.195.13]) by smtp.gmail.com with ESMTPSA id l14sm36686313pfi.23.2016.04.03.23.57.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 03 Apr 2016 23:57:07 -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 v3 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Mon, 4 Apr 2016 14:56:31 +0800 Message-Id: <1459752994-2205-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459752994-2205-1-git-send-email-ming.lei@canonical.com> References: <1459752994-2205-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 BIO_MAX_PAGES is used as maximum count of bvecs, so replace BIO_MAX_SECTORS with BIO_MAX_PAGES since BIO_MAX_SECTORS is to be removed. Signed-off-by: Ming Lei --- fs/xfs/xfs_buf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 9a2191b..b9ecb2d 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1161,9 +1161,7 @@ xfs_buf_ioapply_map( next_chunk: atomic_inc(&bp->b_io_remaining); - nr_pages = BIO_MAX_SECTORS >> (PAGE_SHIFT - BBSHIFT); - if (nr_pages > total_nr_pages) - nr_pages = total_nr_pages; + nr_pages = min(total_nr_pages, BIO_MAX_PAGES); bio = bio_alloc(GFP_NOIO, nr_pages); bio->bi_bdev = bp->b_target->bt_bdev;