aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2019-01-03 18:29:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-01-04 16:13:48 -0500
commitf86196ea8737c98ea96e5f95c99d0367be39a5d2 (patch)
tree5f32fa5d7a14f90dd0b524e303eae13701e6f2aa /fs/afs
parent08d405c8b845a4b871fa3606c9ebe0d0f3b74614 (diff)
fs: don't open code lru_to_page()
Multiple filesystems open code lru_to_page(). Rectify this by moving the macro from mm_inline (which is specific to lru stuff) to the more generic mm.h header and start using the macro where appropriate. No functional changes. Link: http://lkml.kernel.org/r/20181129104810.23361-1-nborisov@suse.com Link: https://lkml.kernel.org/r/20181129075301.29087-1-nborisov@suse.com Signed-off-by: Nikolay Borisov <nborisov@suse.com> Acked-by: Michal Hocko <mhocko@suse.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Pankaj gupta <pagupta@redhat.com> Acked-by: "Yan, Zheng" <zyan@redhat.com> [ceph] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/afs/file.c b/fs/afs/file.c
index d6bc3f5d784b..323ae9912203 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -17,6 +17,7 @@
17#include <linux/writeback.h> 17#include <linux/writeback.h>
18#include <linux/gfp.h> 18#include <linux/gfp.h>
19#include <linux/task_io_accounting_ops.h> 19#include <linux/task_io_accounting_ops.h>
20#include <linux/mm.h>
20#include "internal.h" 21#include "internal.h"
21 22
22static int afs_file_mmap(struct file *file, struct vm_area_struct *vma); 23static int afs_file_mmap(struct file *file, struct vm_area_struct *vma);
@@ -441,7 +442,7 @@ static int afs_readpages_one(struct file *file, struct address_space *mapping,
441 /* Count the number of contiguous pages at the front of the list. Note 442 /* Count the number of contiguous pages at the front of the list. Note
442 * that the list goes prev-wards rather than next-wards. 443 * that the list goes prev-wards rather than next-wards.
443 */ 444 */
444 first = list_entry(pages->prev, struct page, lru); 445 first = lru_to_page(pages);
445 index = first->index + 1; 446 index = first->index + 1;
446 n = 1; 447 n = 1;
447 for (p = first->lru.prev; p != pages; p = p->prev) { 448 for (p = first->lru.prev; p != pages; p = p->prev) {
@@ -473,7 +474,7 @@ static int afs_readpages_one(struct file *file, struct address_space *mapping,
473 * page at the end of the file. 474 * page at the end of the file.
474 */ 475 */
475 do { 476 do {
476 page = list_entry(pages->prev, struct page, lru); 477 page = lru_to_page(pages);
477 list_del(&page->lru); 478 list_del(&page->lru);
478 index = page->index; 479 index = page->index;
479 if (add_to_page_cache_lru(page, mapping, index, 480 if (add_to_page_cache_lru(page, mapping, index,