]> err.no Git - linux-2.6/blobdiff - include/linux/swap.h
[PATCH] swap: scan_swap_map drop swap_device_lock
[linux-2.6] / include / linux / swap.h
index 3bbc41be9bd0cb097c6c4c75b581e5cae5e02bb2..db3b5de7c92faef1ab2329e8b6765ea32c9145ea 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/mmzone.h>
 #include <linux/list.h>
 #include <linux/sched.h>
+
 #include <asm/atomic.h>
 #include <asm/page.h>
 
@@ -106,6 +107,8 @@ enum {
        SWP_USED        = (1 << 0),     /* is slot in swap_info[] used? */
        SWP_WRITEOK     = (1 << 1),     /* ok to write to this swap?    */
        SWP_ACTIVE      = (SWP_USED | SWP_WRITEOK),
+                                       /* add others here before... */
+       SWP_SCANNING    = (1 << 8),     /* refcount in scan_swap_map */
 };
 
 #define SWAP_CLUSTER_MAX 32
@@ -115,8 +118,6 @@ enum {
 
 /*
  * The in-memory structure used to track swap areas.
- * extent_list.prev points at the lowest-index extent.  That list is
- * sorted.
  */
 struct swap_info_struct {
        unsigned int flags;
@@ -124,7 +125,6 @@ struct swap_info_struct {
        struct file *swap_file;
        struct block_device *bdev;
        struct list_head extent_list;
-       int nr_extents;
        struct swap_extent *curr_swap_extent;
        unsigned old_block_size;
        unsigned short * swap_map;
@@ -132,10 +132,10 @@ struct swap_info_struct {
        unsigned int highest_bit;
        unsigned int cluster_next;
        unsigned int cluster_nr;
+       unsigned int pages;
+       unsigned int max;
+       unsigned int inuse_pages;
        int prio;                       /* swap priority */
-       int pages;
-       unsigned long max;
-       unsigned long inuse_pages;
        int next;                       /* next entry on swap list */
 };
 
@@ -148,7 +148,7 @@ struct swap_list_t {
 #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
 
 /* linux/mm/oom_kill.c */
-extern void out_of_memory(unsigned int __nocast gfp_mask);
+extern void out_of_memory(unsigned int __nocast gfp_mask, int order);
 
 /* linux/mm/memory.c */
 extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
@@ -172,7 +172,8 @@ extern int rotate_reclaimable_page(struct page *page);
 extern void swap_setup(void);
 
 /* linux/mm/vmscan.c */
-extern int try_to_free_pages(struct zone **, unsigned int, unsigned int);
+extern int try_to_free_pages(struct zone **, unsigned int);
+extern int zone_reclaim(struct zone *, unsigned int, unsigned int);
 extern int shrink_all_memory(int);
 extern int vm_swappiness;
 
@@ -252,6 +253,8 @@ static inline void put_swap_token(struct mm_struct *mm)
 
 #define si_swapinfo(val) \
        do { (val)->freeswap = (val)->totalswap = 0; } while (0)
+/* only sparc can not include linux/pagemap.h in this file
+ * so leave page_cache_release and release_pages undeclared... */
 #define free_page_and_swap_cache(page) \
        page_cache_release(page)
 #define free_pages_and_swap_cache(pages, nr) \