summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-08-30 01:49:13 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-08-30 01:49:13 -0700
commit2b3414431b7b631ffed4170de9e2101c4adbf31d (patch)
tree490abb3d8c9776313ba6171be87123dce8442863 /include/linux
parente035a04744af68cc89ef4fb20067cde2c9aff735 (diff)
[PATCH] put_page() consolidation
Clean up put_page() and page_cache_release(). It's pretty simple now: #define page_cache_get(page) get_page(page) #define page_cache_release(page) put_page(page)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h24
-rw-r--r--include/linux/pagemap.h9
2 files changed, 15 insertions, 18 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b31b3e3a5fc8..cdfaea4e3307 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -182,6 +182,12 @@ struct page {
};
/*
+ * FIXME: take this include out, include page-flags.h in
+ * files which need it (119 of them)
+ */
+#include <linux/page-flags.h>
+
+/*
* Methods to modify the page usage count.
*
* What counts for a page usage:
@@ -202,14 +208,16 @@ struct page {
})
#define page_count(p) atomic_read(&(p)->count)
#define set_page_count(p,v) atomic_set(&(p)->count, v)
+
extern void FASTCALL(__page_cache_release(struct page *));
-#define put_page(p) \
- do { \
- if (!PageReserved(p) && put_page_testzero(p)) \
- __page_cache_release(p); \
- } while (0)
void FASTCALL(__free_pages_ok(struct page *page, unsigned int order));
+static inline void put_page(struct page *page)
+{
+ if (!PageReserved(page) && put_page_testzero(page))
+ __page_cache_release(page);
+}
+
/*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
@@ -260,12 +268,6 @@ void FASTCALL(__free_pages_ok(struct page *page, unsigned int order));
*/
/*
- * FIXME: take this include out, include page-flags.h in
- * files which need it (119 of them)
- */
-#include <linux/page-flags.h>
-
-/*
* The zone field is never updated after free_area_init_core()
* sets it, so none of the operations on it need to be atomic.
*/
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index ff10783f8632..7a41a4184a27 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -22,13 +22,8 @@
#define PAGE_CACHE_MASK PAGE_MASK
#define PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)
-#define page_cache_get(x) get_page(x)
-
-static inline void page_cache_release(struct page *page)
-{
- if (!PageReserved(page) && put_page_testzero(page))
- __page_cache_release(page);
-}
+#define page_cache_get(page) get_page(page)
+#define page_cache_release(page) put_page(page)
static inline struct page *page_cache_alloc(struct address_space *x)
{