struct zone_t;
/* filemap.c */
-extern void remove_inode_page(struct page *);
extern unsigned long page_unuse(struct page *);
extern void truncate_inode_pages(struct address_space *, loff_t);
extern struct page * find_or_create_page(struct address_space *mapping,
unsigned long index, unsigned int gfp_mask);
-extern struct page * grab_cache_page(struct address_space *mapping,
- unsigned long index);
+/*
+ * Returns locked page at given index in given cache, creating it if needed.
+ */
+static inline struct page *grab_cache_page(struct address_space *mapping, unsigned long index)
+{
+ return find_or_create_page(mapping, index, mapping->gfp_mask);
+}
+
extern struct page * grab_cache_page_nowait(struct address_space *mapping,
unsigned long index);
extern struct page * read_cache_page(struct address_space *mapping,
extern int add_to_page_cache(struct page *page,
struct address_space *mapping, unsigned long index);
+extern void remove_from_page_cache(struct page *page);
+extern void __remove_from_page_cache(struct page *page);
static inline void ___add_to_page_cache(struct page *page,
struct address_space *mapping, unsigned long index)
extern unsigned int nr_free_pages(void);
extern unsigned int nr_free_buffer_pages(void);
extern unsigned int nr_free_pagecache_pages(void);
-extern void __remove_inode_page(struct page *);
/* Incomplete types for prototype declarations: */
struct task_struct;
EXPORT_SYMBOL(ROOT_DEV);
EXPORT_SYMBOL(find_get_page);
EXPORT_SYMBOL(find_lock_page);
-EXPORT_SYMBOL(grab_cache_page);
+EXPORT_SYMBOL(find_or_create_page);
EXPORT_SYMBOL(grab_cache_page_nowait);
EXPORT_SYMBOL(read_cache_page);
EXPORT_SYMBOL(vfs_readlink);
* sure the page is locked and that nobody else uses it - or that usage
* is safe. The caller must hold a write_lock on the mapping's page_lock.
*/
-void __remove_inode_page(struct page *page)
+void __remove_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;
dec_page_state(nr_pagecache);
}
-void remove_inode_page(struct page *page)
+void remove_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;
PAGE_BUG(page);
write_lock(&mapping->page_lock);
- __remove_inode_page(page);
+ __remove_from_page_cache(page);
write_unlock(&mapping->page_lock);
}
goto unlock;
__lru_cache_del(page);
- __remove_inode_page(page);
+ __remove_from_page_cache(page);
unlock_page(page);
page_cache_release(page);
continue;
ClearPageDirty(page);
ClearPageUptodate(page);
- remove_inode_page(page);
+ remove_from_page_cache(page);
page_cache_release(page);
}
return page;
}
-/*
- * Returns locked page at given index in given cache, creating it if needed.
- */
-struct page *grab_cache_page(struct address_space *mapping, unsigned long index)
-{
- return find_or_create_page(mapping, index, mapping->gfp_mask);
-}
-
-
/*
* Same as grab_cache_page, but do not wait if the page is unavailable.
* This is intended for speculative data generators, where the data can
BUG_ON(!PageSwapCache(page));
BUG_ON(PageWriteback(page));
ClearPageDirty(page);
- __remove_inode_page(page);
+ __remove_from_page_cache(page);
INC_CACHE_INFO(del_total);
}
err = radix_tree_reserve(&swapper_space.page_tree, entry.val, &pslot);
if (!err) {
/* Remove it from the page cache */
- __remove_inode_page (page);
+ __remove_from_page_cache(page);
/* Add it to the swap cache */
*pslot = page;
/* point of no return */
if (likely(!PageSwapCache(page))) {
- __remove_inode_page(page);
+ __remove_from_page_cache(page);
write_unlock(&mapping->page_lock);
} else {
swp_entry_t swap;