From patchwork Wed Sep 27 16:03:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9974337 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 0066560365 for ; Wed, 27 Sep 2017 16:04:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7E5229107 for ; Wed, 27 Sep 2017 16:04:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCDFB29115; Wed, 27 Sep 2017 16:04:04 +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 8283F29107 for ; Wed, 27 Sep 2017 16:04:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752414AbdI0QEA (ORCPT ); Wed, 27 Sep 2017 12:04:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:59029 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753068AbdI0QD4 (ORCPT ); Wed, 27 Sep 2017 12:03:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0FFDCACFF; Wed, 27 Sep 2017 16:03:55 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 87F3F1E35DC; Wed, 27 Sep 2017 18:03:54 +0200 (CEST) From: Jan Kara To: Andrew Morton Cc: , , Jan Kara , David Howells , linux-afs@lists.infradead.org Subject: [PATCH 15/15] afs: Use find_get_pages_range_tag() Date: Wed, 27 Sep 2017 18:03:34 +0200 Message-Id: <20170927160334.29513-16-jack@suse.cz> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170927160334.29513-1-jack@suse.cz> References: <20170927160334.29513-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use find_get_pages_range_tag() in afs_writepages_region() as we are interested only in pages from given range. Remove unnecessary code after this conversion. CC: David Howells CC: linux-afs@lists.infradead.org Signed-off-by: Jan Kara --- fs/afs/write.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/afs/write.c b/fs/afs/write.c index 106e43db1115..d62a6b54152d 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -497,20 +497,13 @@ static int afs_writepages_region(struct address_space *mapping, _enter(",,%lx,%lx,", index, end); do { - n = find_get_pages_tag(mapping, &index, PAGECACHE_TAG_DIRTY, - 1, &page); + n = find_get_pages_range_tag(mapping, &index, end, + PAGECACHE_TAG_DIRTY, 1, &page); if (!n) break; _debug("wback %lx", page->index); - if (page->index > end) { - *_next = index; - put_page(page); - _leave(" = 0 [%lx]", *_next); - return 0; - } - /* at this point we hold neither mapping->tree_lock nor lock on * the page itself: the page may be truncated or invalidated * (changing page->mapping to NULL), or even swizzled back from