]>
Commit | Line | Data |
---|---|---|
66ff7419 | 1 | diff -urN linux/include/linux/swap.h linux-2.4.14-patched/include/linux/swap.h |
2 | --- linux/include/linux/swap.h Mon Nov 5 21:42:13 2001 | |
3 | +++ linux-2.4.14-patched/include/linux/swap.h Wed Nov 7 13:17:48 2001 | |
4 | @@ -105,6 +105,7 @@ | |
5 | extern void FASTCALL(__lru_cache_del(struct page *)); | |
6 | extern void FASTCALL(lru_cache_del(struct page *)); | |
7 | ||
8 | +extern void FASTCALL(deactivate_page(struct page *)); | |
9 | extern void FASTCALL(activate_page(struct page *)); | |
10 | ||
11 | extern void swap_setup(void); | |
12 | diff -urN linux/mm/swap.c linux-2.4.14-patched/mm/swap.c | |
13 | --- linux/mm/swap.c Sun Nov 4 19:29:49 2001 | |
14 | +++ linux-2.4.14-patched/mm/swap.c Wed Nov 7 13:17:26 2001 | |
15 | @@ -33,6 +33,32 @@ | |
16 | 8, /* do swap I/O in clusters of this size */ | |
17 | }; | |
18 | ||
19 | +/** | |
20 | + * (de)activate_page - move pages from/to active and inactive lists | |
21 | + * @page: the page we want to move | |
22 | + * @nolock - are we already holding the pagemap_lru_lock? | |
23 | + * | |
24 | + * Deactivate_page will move an active page to the right | |
25 | + * inactive list, while activate_page will move a page back | |
26 | + * from one of the inactive lists to the active list. If | |
27 | + * called on a page which is not on any of the lists, the | |
28 | + * page is left alone. | |
29 | + */ | |
30 | +static inline void deactivate_page_nolock(struct page * page) | |
31 | +{ | |
32 | + if (PageActive(page)) { | |
33 | + del_page_from_active_list(page); | |
34 | + add_page_to_inactive_list(page); | |
35 | + } | |
36 | +} | |
37 | + | |
38 | +void deactivate_page(struct page * page) | |
39 | +{ | |
40 | + spin_lock(&pagemap_lru_lock); | |
41 | + deactivate_page_nolock(page); | |
42 | + spin_unlock(&pagemap_lru_lock); | |
43 | +} | |
44 | + | |
45 | /* | |
46 | * Move an inactive page to the active list. | |
47 | */ | |
48 |