From patchwork Sun Apr 17 21:29:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8863801 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 E09C09F441 for ; Sun, 17 Apr 2016 21:32:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFC9E20149 for ; Sun, 17 Apr 2016 21:32:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C07920145 for ; Sun, 17 Apr 2016 21:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751692AbcDQVbN (ORCPT ); Sun, 17 Apr 2016 17:31:13 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:34131 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbcDQVbL (ORCPT ); Sun, 17 Apr 2016 17:31:11 -0400 Received: by mail-yw0-f193.google.com with SMTP id h6so21372355ywc.1; Sun, 17 Apr 2016 14:31:11 -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=jhJroKa8ozwfq7s/AEKPDd+eIlWKhIyODW42+bUjl4niBXnuOt3Xmb6JIQLfECVDNq xleJFdP4sMrZEzHXOv2lb9uyOhy/+IZPY1H436gHJbm8Rjb0q6sdXSMU3nJKdactqMq6 PLa1FyfkVAoN/kaNivX6b/UNrVetNIxDe4Xb00cqgqMDbRWULJQJ7AZGi2DnY7EgfLWW bW2iZqpq+TBdPrKD7gV/wTKGO28gEsS4MBikDK3BZI28vebq9Ca2vQlr8eE2meHQIiY2 JwYowgpNRGjgrPxPIY7chaKWvPn+dxTkBOSr1/REgtgNnevGtsMZ1ae5nkpSxzdrxxYr wPqQ== X-Gm-Message-State: AOPr4FX0ltUrZi/SZORjDak1IvUCEGP4f4JVOsWYW6WnTCK9oK+OMm8YzRlADQSbtKiMjA== X-Received: by 10.37.209.20 with SMTP id i20mr3962901ybg.15.1460928670977; Sun, 17 Apr 2016 14:31:10 -0700 (PDT) Received: from localhost ([107.13.171.182]) by smtp.gmail.com with ESMTPSA id x8sm30593853ywa.9.2016.04.17.14.31.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 17 Apr 2016 14:31:10 -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 v5 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Mon, 18 Apr 2016 05:29:54 +0800 Message-Id: <1460928615-20894-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460928615-20894-1-git-send-email-ming.lei@canonical.com> References: <1460928615-20894-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=-6.5 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, 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 Reviewed-by: Christoph Hellwig --- 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;