patch-2.4.5 linux/mm/swap_state.c
Next file: linux/mm/swapfile.c
Previous file: linux/mm/slab.c
Back to the patch index
Back to the overall index
- Lines: 31
- Date:
Thu May 24 15:20:18 2001
- Orig file:
v2.4.4/linux/mm/swap_state.c
- Orig date:
Wed Apr 25 14:46:21 2001
diff -u --recursive --new-file v2.4.4/linux/mm/swap_state.c linux/mm/swap_state.c
@@ -189,7 +189,6 @@
struct page * read_swap_cache_async(swp_entry_t entry)
{
struct page *found_page = 0, *new_page;
- unsigned long new_page_addr;
/*
* Make sure the swap entry is still in use.
@@ -203,10 +202,9 @@
if (found_page)
goto out_free_swap;
- new_page_addr = __get_free_page(GFP_USER);
- if (!new_page_addr)
+ new_page = alloc_page(GFP_USER);
+ if (!new_page)
goto out_free_swap; /* Out of memory */
- new_page = virt_to_page(new_page_addr);
/*
* Check the swap cache again, in case we stalled above.
@@ -217,7 +215,8 @@
/*
* Add it to the swap cache and read its contents.
*/
- lock_page(new_page);
+ if (TryLockPage(new_page))
+ BUG();
add_to_swap_cache(new_page, entry);
rw_swap_page(READ, new_page);
return new_page;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)