Commit cda55f33 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Clean up various buffer-head dependencies

From: William Lee Irwin III <wli@holomorphy.com>

Remove page_has_buffers() from various functions, document the dependencies
on buffer_head.h from other files besides filemap.c, and s/this file/core VM/
in filemap.c
parent 5549174d
...@@ -31,12 +31,11 @@ ...@@ -31,12 +31,11 @@
* This is needed for the following functions: * This is needed for the following functions:
* - try_to_release_page * - try_to_release_page
* - block_invalidatepage * - block_invalidatepage
* - page_has_buffers
* - generic_osync_inode * - generic_osync_inode
* *
* FIXME: remove all knowledge of the buffer layer from this file * FIXME: remove all knowledge of the buffer layer from the core VM
*/ */
#include <linux/buffer_head.h> #include <linux/buffer_head.h> /* for generic_osync_inode */
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mman.h> #include <asm/mman.h>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/pagevec.h> #include <linux/pagevec.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm_inline.h> #include <linux/mm_inline.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h> /* for try_to_release_page() */
#include <linux/percpu.h> #include <linux/percpu.h>
/* How many pages do we try to swap or page in/out together? */ /* How many pages do we try to swap or page in/out together? */
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/buffer_head.h> /* block_sync_page() */
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -187,7 +186,7 @@ void delete_from_swap_cache(struct page *page) ...@@ -187,7 +186,7 @@ void delete_from_swap_cache(struct page *page)
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
BUG_ON(PageWriteback(page)); BUG_ON(PageWriteback(page));
BUG_ON(page_has_buffers(page)); BUG_ON(PagePrivate(page));
entry.val = page->index; entry.val = page->index;
...@@ -236,7 +235,7 @@ int move_from_swap_cache(struct page *page, unsigned long index, ...@@ -236,7 +235,7 @@ int move_from_swap_cache(struct page *page, unsigned long index,
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
BUG_ON(PageWriteback(page)); BUG_ON(PageWriteback(page));
BUG_ON(page_has_buffers(page)); BUG_ON(PagePrivate(page));
entry.val = page->index; entry.val = page->index;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/shm.h> #include <linux/shm.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/buffer_head.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
...@@ -300,7 +299,7 @@ int remove_exclusive_swap_page(struct page *page) ...@@ -300,7 +299,7 @@ int remove_exclusive_swap_page(struct page *page)
struct swap_info_struct * p; struct swap_info_struct * p;
swp_entry_t entry; swp_entry_t entry;
BUG_ON(page_has_buffers(page)); BUG_ON(PagePrivate(page));
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
if (!PageSwapCache(page)) if (!PageSwapCache(page))
...@@ -355,7 +354,7 @@ void free_swap_and_cache(swp_entry_t entry) ...@@ -355,7 +354,7 @@ void free_swap_and_cache(swp_entry_t entry)
if (page) { if (page) {
int one_user; int one_user;
BUG_ON(page_has_buffers(page)); BUG_ON(PagePrivate(page));
page_cache_get(page); page_cache_get(page);
one_user = (page_count(page) == 2); one_user = (page_count(page) == 2);
/* Only cache user (+us), or swap space full? Free it! */ /* Only cache user (+us), or swap space full? Free it! */
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/buffer_head.h> /* for try_to_release_page() */ #include <linux/buffer_head.h> /* for try_to_release_page(),
buffer_heads_over_limit */
#include <linux/mm_inline.h> #include <linux/mm_inline.h>
#include <linux/pagevec.h> #include <linux/pagevec.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment