From patchwork Thu Apr 18 18:41:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hubcap@kernel.org X-Patchwork-Id: 10907863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72D031390 for ; Thu, 18 Apr 2019 18:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B10D285DB for ; Thu, 18 Apr 2019 18:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA2228D5E; Thu, 18 Apr 2019 18:42:58 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 EC5C028D60 for ; Thu, 18 Apr 2019 18:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389999AbfDRSmz (ORCPT ); Thu, 18 Apr 2019 14:42:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389894AbfDRSmx (ORCPT ); Thu, 18 Apr 2019 14:42:53 -0400 Received: from localhost.localdomain (unknown [24.213.116.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 246C2217D7; Thu, 18 Apr 2019 18:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555612972; bh=M7agIjaEv4Qu6jCzPQ9uS9N3m4i7k+dodqTAAU4/F2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjAuDaEXKfwWxmvou3zWeEZFbQgtPsqZjN44wLpWfh21hZl/Kikj0yfyZP9fPyTOx rgtWP4pEYoxSfuLzHubnNokQ7cZl/7KNKUQ6VXR6Qe0xgngecRDW0PumQk2ext1XxF TZaqyqNYlfTaT7G7UL+AIG6vXhETdlFPQu4/b1YA= From: hubcap@kernel.org To: linux-fsdevel@vger.kernel.org, christoph@lameter.com Cc: Martin Brandenburg , Mike Marshall Subject: [PATCH 09/22] orangefs: remove orangefs_readpages Date: Thu, 18 Apr 2019 14:41:01 -0400 Message-Id: <20190418184113.9152-10-hubcap@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190418184113.9152-1-hubcap@kernel.org> References: <20190418184113.9152-1-hubcap@kernel.org> MIME-Version: 1.0 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 From: Martin Brandenburg It's a copy of the loop which would run in read_pages from mm/readahead.c. Signed-off-by: Martin Brandenburg Signed-off-by: Mike Marshall --- fs/orangefs/inode.c | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 2708bf8af9cf..fd23a8ca641c 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -15,7 +15,7 @@ #include "orangefs-kernel.h" #include "orangefs-bufmap.h" -static int read_one_page(struct page *page) +static int orangefs_readpage(struct file *file, struct page *page) { int ret; int max_block; @@ -60,42 +60,6 @@ static int read_one_page(struct page *page) return ret; } -static int orangefs_readpage(struct file *file, struct page *page) -{ - return read_one_page(page); -} - -static int orangefs_readpages(struct file *file, - struct address_space *mapping, - struct list_head *pages, - unsigned nr_pages) -{ - int page_idx; - int ret; - - gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_readpages called\n"); - - for (page_idx = 0; page_idx < nr_pages; page_idx++) { - struct page *page; - - page = lru_to_page(pages); - list_del(&page->lru); - if (!add_to_page_cache(page, - mapping, - page->index, - readahead_gfp_mask(mapping))) { - ret = read_one_page(page); - gossip_debug(GOSSIP_INODE_DEBUG, - "failure adding page to cache, read_one_page returned: %d\n", - ret); - } else { - put_page(page); - } - } - BUG_ON(!list_empty(pages)); - return 0; -} - static void orangefs_invalidatepage(struct page *page, unsigned int offset, unsigned int length) @@ -141,7 +105,6 @@ static ssize_t orangefs_direct_IO(struct kiocb *iocb, /** ORANGEFS2 implementation of address space operations */ static const struct address_space_operations orangefs_address_operations = { .readpage = orangefs_readpage, - .readpages = orangefs_readpages, .invalidatepage = orangefs_invalidatepage, .releasepage = orangefs_releasepage, .direct_IO = orangefs_direct_IO,