Commit fb91d591 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] small filemap.c/pagemap.h cleanups

 - remove page_cache_entry - I think it never ever was actually used.
 - remmove wake_up_page (as in 2.4) - never used
 - remove misleading comment ontop of pagemap.h
 - make wait_on_page* directly call wait_on_page_bit
 - some reordering and additional comments in pagemap.h
parent b660b3b3
......@@ -2,17 +2,11 @@
#define _LINUX_PAGEMAP_H
/*
* Page-mapping primitive inline functions
*
* Copyright 1995 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <linux/highmem.h>
/*
......@@ -36,10 +30,8 @@ static inline struct page *page_cache_alloc(struct address_space *x)
return alloc_pages(x->gfp_mask, 0);
}
/*
* From a kernel address, get the "struct page *"
*/
#define page_cache_entry(x) virt_to_page(x)
typedef int filler_t(void *, struct page *);
extern struct page * find_get_page(struct address_space *mapping,
unsigned long index);
......@@ -54,6 +46,9 @@ extern struct page * grab_cache_page(struct address_space *mapping,
unsigned long index);
extern struct page * grab_cache_page_nowait(struct address_space *mapping,
unsigned long index);
extern struct page * read_cache_page(struct address_space *mapping,
unsigned long index, filler_t *filler,
void *data);
extern int add_to_page_cache(struct page *page,
struct address_space *mapping, unsigned long index);
......@@ -73,21 +68,34 @@ static inline void ___add_to_page_cache(struct page *page,
extern void FASTCALL(lock_page(struct page *page));
extern void FASTCALL(unlock_page(struct page *page));
extern void end_page_writeback(struct page *page);
extern void ___wait_on_page_locked(struct page *);
/*
* This is exported only for wait_on_page_locked/wait_on_page_writeback.
* Never use this directly!
*/
extern void FASTCALL(wait_on_page_bit(struct page *page, int bit_nr));
/*
* Wait for a page to be unlocked.
*
* This must be called with the caller "holding" the page,
* ie with increased "page->count" so that the page won't
* go away during the wait..
*/
static inline void wait_on_page_locked(struct page *page)
{
if (PageLocked(page))
___wait_on_page_locked(page);
wait_on_page_bit(page, PG_locked);
}
extern void wake_up_page(struct page *);
extern void wait_on_page_writeback(struct page *page);
typedef int filler_t(void *, struct page*);
/*
* Wait for a page to complete writeback
*/
static inline void wait_on_page_writeback(struct page *page)
{
if (PageWriteback(page))
wait_on_page_bit(page, PG_writeback);
}
extern struct page *read_cache_page(struct address_space *, unsigned long,
filler_t *, void *);
#endif
extern void end_page_writeback(struct page *page);
#endif /* _LINUX_PAGEMAP_H */
......@@ -600,7 +600,7 @@ static inline wait_queue_head_t *page_waitqueue(struct page *page)
return &zone->wait_table[hash_ptr(page, zone->wait_table_bits)];
}
static void wait_on_page_bit(struct page *page, int bit_nr)
void wait_on_page_bit(struct page *page, int bit_nr)
{
wait_queue_head_t *waitqueue = page_waitqueue(page);
struct task_struct *tsk = current;
......@@ -617,28 +617,7 @@ static void wait_on_page_bit(struct page *page, int bit_nr)
__set_task_state(tsk, TASK_RUNNING);
remove_wait_queue(waitqueue, &wait);
}
/*
* Wait for a page to be unlocked.
*
* This must be called with the caller "holding" the page,
* ie with increased "page->count" so that the page won't
* go away during the wait..
*/
void ___wait_on_page_locked(struct page *page)
{
wait_on_page_bit(page, PG_locked);
}
EXPORT_SYMBOL(___wait_on_page_locked);
/*
* Wait for a page to complete writeback
*/
void wait_on_page_writeback(struct page *page)
{
wait_on_page_bit(page, PG_writeback);
}
EXPORT_SYMBOL(wait_on_page_writeback);
EXPORT_SYMBOL(wait_on_page_bit);
/**
* unlock_page() - unlock a locked page
......@@ -706,12 +685,6 @@ static void __lock_page(struct page *page)
remove_wait_queue(waitqueue, &wait);
}
void wake_up_page(struct page *page)
{
wake_up(page_waitqueue(page));
}
EXPORT_SYMBOL(wake_up_page);
/*
* Get an exclusive lock on the page, optimistically
* assuming it's not locked..
......
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