From patchwork Thu Apr 14 11:46:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8834661 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 9B99CC0553 for ; Thu, 14 Apr 2016 11:49:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8D3E2011D for ; Thu, 14 Apr 2016 11:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DAE5520114 for ; Thu, 14 Apr 2016 11:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754217AbcDNLsX (ORCPT ); Thu, 14 Apr 2016 07:48:23 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36302 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753717AbcDNLsU (ORCPT ); Thu, 14 Apr 2016 07:48:20 -0400 Received: by mail-oi0-f65.google.com with SMTP id v126so9504398oia.3; Thu, 14 Apr 2016 04:48:19 -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=Bdx+FX04rH1P1yfQi+6WDJ/wd8VjFsgwoxfdXrup+RNe1RB4muE53uYmAAb0Ma8wnW J99nUmQqHVc0TdX+zrWI4EXn8uC7uqu7Ev5JlQ6fKHbXLNTrnDeF4bOB/Ti9/jgz8GeX rOGBZ4ScqQKXTtXS4ezgYEBfk0wMmnKNLE0U8iWHqFItQ2g1WrDXcxQeGMVJfPurIaOI orEyH43ct4++tWIuQO0Kkn8AUHYXGbgChVfBqsS8dTp7zs7iiCGuEj7iBlKWBnIB3IAk 5mATfHoghZnmfcWHNodFW9+iiP1Lw63SHpoRS/NcJ0pjLQZAmikTN6e0RV4j569LRuz8 x5fQ== X-Gm-Message-State: AOPr4FVyVtcgXaB8U8DXkOoALeHYDcMHIMSvxzwYeXSlj4w3QMMjfgvwmmmDDrfxA+Ua6A== X-Received: by 10.157.11.210 with SMTP id 76mr2657163oth.103.1460634499295; Thu, 14 Apr 2016 04:48:19 -0700 (PDT) Received: from localhost ([12.228.154.70]) by smtp.gmail.com with ESMTPSA id 5sm4747858otw.19.2016.04.14.04.48.18 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 14 Apr 2016 04:48:18 -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 , Dave Chinner , xfs@oss.sgi.com (supporter:XFS FILESYSTEM) Subject: [PATCH v4 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Thu, 14 Apr 2016 19:46:58 +0800 Message-Id: <1460634438-26530-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460634438-26530-1-git-send-email-ming.lei@canonical.com> References: <1460634438-26530-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.9 required=5.0 tests=BAYES_00, 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 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;