From patchwork Wed Mar 30 16:17:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8699661 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 571829F39A for ; Wed, 30 Mar 2016 16:19:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FE2920384 for ; Wed, 30 Mar 2016 16:19:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB6D72013D for ; Wed, 30 Mar 2016 16:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932610AbcC3QRu (ORCPT ); Wed, 30 Mar 2016 12:17:50 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35359 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbcC3QRs (ORCPT ); Wed, 30 Mar 2016 12:17:48 -0400 Received: by mail-pa0-f67.google.com with SMTP id hn5so5333434pac.2; Wed, 30 Mar 2016 09:17:48 -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=HsLVnKTktQ81QfEwaY0YA6TE+xswP/AXn43WigwGyIJb/kln4I6414qR3ZDMQcWT1n m6C/6tCjMZDkQAWQyqvA5VtDPrNXAl3gUheXHxAoXdbJLAaFhLuaiAURSIkU8t7lj2LX ZviF15bQbdx+IB/sDZSdeKfmPOezdHc2NPdGxJXf8tJ2hY7YK9zyj3eNYSIFtvIg3eyW qAx4klpJeKC3VHfK1Fluwl7HN4fEvebzKWDu/aY2H/zs/yVXY+kOj2GE3bzAqEjgbp9H 2AdR9UNZgWZhZ9vKMKP9ZDN3cm6AeCBwvgmDYsrX0hL8MJorX+p3IOh/rr4i/meHvLu9 4VzQ== X-Gm-Message-State: AD7BkJL0OHQ6V0eBaKbzMFKxmRLr7h9EYBt41ljbdgaOm+0buZ+wJYvFmg5eLPBTVm3FzA== X-Received: by 10.66.118.106 with SMTP id kl10mr14425048pab.78.1459354667865; Wed, 30 Mar 2016 09:17:47 -0700 (PDT) Received: from localhost (45-125-195-13.ip4.readyserver.sg. [45.125.195.13]) by smtp.gmail.com with ESMTPSA id g28sm7057717pfd.25.2016.03.30.09.17.46 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 30 Mar 2016 09:17:47 -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 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Thu, 31 Mar 2016 00:17:14 +0800 Message-Id: <1459354637-17415-6-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 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;