From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:33772 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751782AbeCTRDB (ORCPT ); Tue, 20 Mar 2018 13:03:01 -0400 Received: by mail-qt0-f194.google.com with SMTP id i8so2354899qtj.0 for ; Tue, 20 Mar 2018 10:03:01 -0700 (PDT) From: Martin Brandenburg To: hubcap@omnibond.com, linux-fsdevel@vger.kernel.org Cc: Martin Brandenburg Subject: [PATCH 17/24] orangefs: remove orangefs_readpages Date: Tue, 20 Mar 2018 17:02:27 +0000 Message-Id: <20180320170234.1412-18-martin@omnibond.com> In-Reply-To: <20180320170234.1412-1-martin@omnibond.com> References: <20180320170234.1412-1-martin@omnibond.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: It's a copy of the loop which would run in read_pages from mm/readahead.c. Signed-off-by: Martin Brandenburg --- 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 d3ff038c7694..be7f2cdb3342 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -14,7 +14,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; @@ -59,42 +59,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 = list_entry(pages->prev, struct page, lru); - 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) @@ -140,7 +104,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, -- 2.16.2