diff options
| author | Andrew Morton <akpm@zip.com.au> | 2002-04-29 23:52:37 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-04-29 23:52:37 -0700 |
| commit | aa78091f0f2860df00a4ccc5d4609afd9d831dd0 (patch) | |
| tree | fe91202ae1fed74c403bf6f7cc9caf5a3f2ca5da /mm/memory.c | |
| parent | 68872e78c90ddfe683bf1c10ee93323f6d640251 (diff) | |
[PATCH] cleanup page flags
page->flags cleanup.
Moves the definitions of the page->flags bits and all the PageFoo
macros into linux/page-flags.h. That file is currently included from
mm.h, but the stage is set to remove that and include page-flags.h
direct in all .c files which require that. (120 of them).
The patch also makes all the page flag macros and functions consistent:
For PG_foo, the following functions are defined:
SetPageFoo
ClearPageFoo
TestSetPageFoo
TestClearPageFoo
PageFoo
and that's it.
- Page_Uptodate is renamed to PageUptodate
- LockPage is removed. All users updated to use SetPageLocked
- UnlockPage is removed. All callers updated to use unlock_page().
it's a real function - there's no need to hide that fact.
- PageTestandClearReferenced renamed to TestClearPageReferenced
- PageSetSlab renamed to SetPageSlab
- __SetPageReserved is removed. It's an infinitesimally small
microoptimisation, and is inconsistent.
- TryLockPage is renamed to TestSetPageLocked
- PageSwapCache() is renamed to page_swap_cache(), so it doesn't
pretend to be a page->flags bit test.
Diffstat (limited to 'mm/memory.c')
| -rw-r--r-- | mm/memory.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/memory.c b/mm/memory.c index 0bad3cf9636c..b3158d2574ae 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -653,7 +653,7 @@ void unmap_kiobuf (struct kiobuf *iobuf) map = iobuf->maplist[i]; if (map) { if (iobuf->locked) - UnlockPage(map); + unlock_page(map); /* FIXME: cache flush missing for rw==READ * FIXME: call the correct reference counting function */ @@ -698,11 +698,11 @@ int lock_kiovec(int nr, struct kiobuf *iovec[], int wait) if (!page) continue; - if (TryLockPage(page)) { + if (TestSetPageLocked(page)) { while (j--) { struct page *tmp = *--ppage; if (tmp) - UnlockPage(tmp); + unlock_page(tmp); } goto retry; } @@ -768,7 +768,7 @@ int unlock_kiovec(int nr, struct kiobuf *iovec[]) page = *ppage; if (!page) continue; - UnlockPage(page); + unlock_page(page); } } return 0; @@ -982,7 +982,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, if (!VALID_PAGE(old_page)) goto bad_wp_page; - if (!TryLockPage(old_page)) { + if (!TestSetPageLocked(old_page)) { int reuse = can_share_swap_page(old_page); unlock_page(old_page); if (reuse) { |
