From patchwork Sun Apr 3 16:31:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8734591 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 2D33EC0553 for ; Sun, 3 Apr 2016 16:32:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 529732021F for ; Sun, 3 Apr 2016 16:32:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60E6C20212 for ; Sun, 3 Apr 2016 16:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396AbcDCQbz (ORCPT ); Sun, 3 Apr 2016 12:31:55 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33144 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754369AbcDCQbx (ORCPT ); Sun, 3 Apr 2016 12:31:53 -0400 Received: by mail-pf0-f178.google.com with SMTP id 184so26993020pff.0; Sun, 03 Apr 2016 09:31:53 -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=I2ZmZeuc2DD5um05cI9y/5/7ctjQZ56tUatVIpOiAGy/YYcoQzMSfJSGYCDhWq3G3m /XeCqwBIGn5k1rOUtwkZdiBKFd8TTTlm14mu17jFiHSSbaZ2Kx+K0lxf30vh5NPjc0i8 vI1tn02DnYlQrvlgwCyKm4z5oyPXkykpilsqfPUa9TDZ2IPQQNjPOVxdKmGPfwvVsKsn vVOXRrfLxfbd2tkRcXiyCKDlnjmNDpVXPRzSB3iZovgvC4qWo5sOfEvAZLyUW0PxdKfb o7P3j39bIGBwy002wPUzk/HeXZharPe4LCEZy+YDJZWldXTPAqzF0j0oY7AqYlLI/RO3 LMnA== X-Gm-Message-State: AD7BkJJM0YiorB6FGNW7G3khtlyqJVWANT9Myis3qWzbfSPXjPQ9idtJFmCLbXAEMRzYYA== X-Received: by 10.98.14.2 with SMTP id w2mr14085679pfi.35.1459701112604; Sun, 03 Apr 2016 09:31:52 -0700 (PDT) Received: from localhost (45-125-195-13.ip4.readyserver.sg. [45.125.195.13]) by smtp.gmail.com with ESMTPSA id 17sm33436657pfp.96.2016.04.03.09.31.51 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 03 Apr 2016 09:31:52 -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 v2 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Mon, 4 Apr 2016 00:31:06 +0800 Message-Id: <1459701069-31406-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459701069-31406-1-git-send-email-ming.lei@canonical.com> References: <1459701069-31406-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;