diff options
author | Andy Whitcroft <apw@shadowen.org> | 2006-12-06 23:33:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:25 -0500 |
commit | 33f2ef89f8e181486b63fdbdc97c6afa6ca9f34b (patch) | |
tree | b90eac24ff367bc628c44eaa51a9f0ea1b69d1a4 /include/linux/mm.h | |
parent | 3c517a6132098ca37e122a2980fc64a9e798b0d7 (diff) |
[PATCH] mm: make compound page destructor handling explicit
Currently we we use the lru head link of the second page of a compound page
to hold its destructor. This was ok when it was purely an internal
implmentation detail. However, hugetlbfs overrides this destructor
violating the layering. Abstract this out as explicit calls, also
introduce a type for the callback function allowing them to be type
checked. For each callback we pre-declare the function, causing a type
error on definition rather than on use elsewhere.
[akpm@osdl.org: cleanups]
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 0e266fe1b4c4..a17b147c61e7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -296,6 +296,24 @@ void put_pages_list(struct list_head *pages); | |||
296 | void split_page(struct page *page, unsigned int order); | 296 | void split_page(struct page *page, unsigned int order); |
297 | 297 | ||
298 | /* | 298 | /* |
299 | * Compound pages have a destructor function. Provide a | ||
300 | * prototype for that function and accessor functions. | ||
301 | * These are _only_ valid on the head of a PG_compound page. | ||
302 | */ | ||
303 | typedef void compound_page_dtor(struct page *); | ||
304 | |||
305 | static inline void set_compound_page_dtor(struct page *page, | ||
306 | compound_page_dtor *dtor) | ||
307 | { | ||
308 | page[1].lru.next = (void *)dtor; | ||
309 | } | ||
310 | |||
311 | static inline compound_page_dtor *get_compound_page_dtor(struct page *page) | ||
312 | { | ||
313 | return (compound_page_dtor *)page[1].lru.next; | ||
314 | } | ||
315 | |||
316 | /* | ||
299 | * Multiple processes may "see" the same page. E.g. for untouched | 317 | * Multiple processes may "see" the same page. E.g. for untouched |
300 | * mappings of /dev/null, all processes see the same page full of | 318 | * mappings of /dev/null, all processes see the same page full of |
301 | * zeroes, and text pages of executables and shared libraries have | 319 | * zeroes, and text pages of executables and shared libraries have |