f2fs: clean up with list_{first, last}_entry
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / fs / f2fs / data.c
index 6c8465d26bb1de251fb91b6d6b01abb4f777ae30..f1001c871cb6575f4c49a7b97bc58cc5e1eeddce 100644 (file)
@@ -1144,7 +1144,7 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
 
                prefetchw(&page->flags);
                if (pages) {
-                       page = list_entry(pages->prev, struct page, lru);
+                       page = list_last_entry(pages, struct page, lru);
                        list_del(&page->lru);
                        if (add_to_page_cache_lru(page, mapping,
                                                  page->index, GFP_KERNEL))
@@ -1262,7 +1262,7 @@ static int f2fs_read_data_pages(struct file *file,
                        struct list_head *pages, unsigned nr_pages)
 {
        struct inode *inode = file->f_mapping->host;
-       struct page *page = list_entry(pages->prev, struct page, lru);
+       struct page *page = list_last_entry(pages, struct page, lru);
 
        trace_f2fs_readpages(inode, page, nr_pages);