From patchwork Mon May 30 13:34:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9141515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7031760801 for ; Mon, 30 May 2016 13:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64BBC280B2 for ; Mon, 30 May 2016 13:40:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 596D22819E; Mon, 30 May 2016 13:40:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2F8F2819C for ; Mon, 30 May 2016 13:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161496AbcE3Ngj (ORCPT ); Mon, 30 May 2016 09:36:39 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35755 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161219AbcE3Ngi (ORCPT ); Mon, 30 May 2016 09:36:38 -0400 Received: by mail-pa0-f67.google.com with SMTP id gp3so14714481pac.2; Mon, 30 May 2016 06:36:37 -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=ptVANtwAVSDpuuIFlDw+2sEcPc44lPcTPbSP7Z4Rlv0=; b=BSQXwQmm/cB8u8Yc2G2XbPAxNeftO1yngQSyqyUiUNBKobcontWiLmHKpMf33nbNER iFqyi6evSCuRuvR/G7z/onB/7IctsDXenp//yIdVOPveEmwpsTDMdubRK2/8TOow0PhP yt5W4kHTtmkXHaOovdywoi1C1fAumjg5xLB3oq/C9Y+MSVZZ12D6Csene6aM+psBgz4I G1YrrQEb5mzPLk4XVB6kylHuUjLNSSu3uttnFJUR771L5VMcWI3SLOf3om0QSCyNQ1i4 2s2GvUcPGULkAQzXmmpYtQyPnHNmj68OBFzW9r5mdTmaxg+bIMlL2x+RflxjfMLk4o+V ARRw== X-Gm-Message-State: ALyK8tKG2oLHsZlTlbZiXHrFqXcmadvmvt8IUg77mb4H8fybZE5jK68F2v5R7XwlDAZHuA== X-Received: by 10.66.87.198 with SMTP id ba6mr47233640pab.151.1464615397412; Mon, 30 May 2016 06:36:37 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id v27sm33217903pfi.49.2016.05.30.06.36.36 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 30 May 2016 06:36:36 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Dave Chinner , xfs@oss.sgi.com (supporter:XFS FILESYSTEM) Subject: [PATCH v6 5/8] fs: xfs: replace BIO_MAX_SECTORS with BIO_MAX_PAGES Date: Mon, 30 May 2016 21:34:33 +0800 Message-Id: <1464615294-9946-6-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464615294-9946-1-git-send-email-ming.lei@canonical.com> References: <1464615294-9946-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-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. Reviewed-by: Christoph Hellwig 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 e71cfbd..e5d713b 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1157,9 +1157,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;