Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | static inline void |
| 2 | add_page_to_active_list(struct zone *zone, struct page *page) |
| 3 | { |
| 4 | list_add(&page->lru, &zone->active_list); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 5 | __inc_zone_state(zone, NR_ACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | } |
| 7 | |
| 8 | static inline void |
| 9 | add_page_to_inactive_list(struct zone *zone, struct page *page) |
| 10 | { |
| 11 | list_add(&page->lru, &zone->inactive_list); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 12 | __inc_zone_state(zone, NR_INACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | static inline void |
| 16 | del_page_from_active_list(struct zone *zone, struct page *page) |
| 17 | { |
| 18 | list_del(&page->lru); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 19 | __dec_zone_state(zone, NR_ACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | static inline void |
| 23 | del_page_from_inactive_list(struct zone *zone, struct page *page) |
| 24 | { |
| 25 | list_del(&page->lru); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 26 | __dec_zone_state(zone, NR_INACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | static inline void |
| 30 | del_page_from_lru(struct zone *zone, struct page *page) |
| 31 | { |
| 32 | list_del(&page->lru); |
| 33 | if (PageActive(page)) { |
Nick Piggin | 6745391 | 2006-03-22 00:08:00 -0800 | [diff] [blame] | 34 | __ClearPageActive(page); |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 35 | __dec_zone_state(zone, NR_ACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | } else { |
Christoph Lameter | c878538 | 2007-02-10 01:43:01 -0800 | [diff] [blame] | 37 | __dec_zone_state(zone, NR_INACTIVE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | } |
| 39 | } |
Christoph Lameter | 21eac81 | 2006-01-08 01:00:45 -0800 | [diff] [blame] | 40 | |