blob: 895bc4e93039cdba7f6585b484abed3b9eb4a920 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001static inline void
2add_page_to_active_list(struct zone *zone, struct page *page)
3{
4 list_add(&page->lru, &zone->active_list);
Christoph Lameterc8785382007-02-10 01:43:01 -08005 __inc_zone_state(zone, NR_ACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -07006}
7
8static inline void
9add_page_to_inactive_list(struct zone *zone, struct page *page)
10{
11 list_add(&page->lru, &zone->inactive_list);
Christoph Lameterc8785382007-02-10 01:43:01 -080012 __inc_zone_state(zone, NR_INACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070013}
14
15static inline void
16del_page_from_active_list(struct zone *zone, struct page *page)
17{
18 list_del(&page->lru);
Christoph Lameterc8785382007-02-10 01:43:01 -080019 __dec_zone_state(zone, NR_ACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020}
21
22static inline void
23del_page_from_inactive_list(struct zone *zone, struct page *page)
24{
25 list_del(&page->lru);
Christoph Lameterc8785382007-02-10 01:43:01 -080026 __dec_zone_state(zone, NR_INACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070027}
28
29static inline void
30del_page_from_lru(struct zone *zone, struct page *page)
31{
32 list_del(&page->lru);
33 if (PageActive(page)) {
Nick Piggin67453912006-03-22 00:08:00 -080034 __ClearPageActive(page);
Christoph Lameterc8785382007-02-10 01:43:01 -080035 __dec_zone_state(zone, NR_ACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 } else {
Christoph Lameterc8785382007-02-10 01:43:01 -080037 __dec_zone_state(zone, NR_INACTIVE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 }
39}
Christoph Lameter21eac812006-01-08 01:00:45 -080040