[sibyte]: upgrade to 2.6.37.4
[openwrt.git] / target / linux / generic / patches-2.6.34 / 040-compcache_swap_notify_core_support.patch
1 --- a/include/linux/blkdev.h
2 +++ b/include/linux/blkdev.h
3 @@ -1287,6 +1287,8 @@ struct block_device_operations {
4                                                 unsigned long long);
5         int (*revalidate_disk) (struct gendisk *);
6         int (*getgeo)(struct block_device *, struct hd_geometry *);
7 +        /* this callback is with swap_lock and sometimes page table lock held */
8 +        void (*swap_slot_free_notify) (struct block_device *, unsigned long);
9         struct module *owner;
10  };
11  
12 --- a/mm/swapfile.c
13 +++ b/mm/swapfile.c
14 @@ -576,6 +576,7 @@ static unsigned char swap_entry_free(str
15  
16         /* free if no reference */
17         if (!usage) {
18 +               struct gendisk *disk = p->bdev->bd_disk;
19                 if (offset < p->lowest_bit)
20                         p->lowest_bit = offset;
21                 if (offset > p->highest_bit)
22 @@ -585,6 +586,8 @@ static unsigned char swap_entry_free(str
23                         swap_list.next = p->type;
24                 nr_swap_pages++;
25                 p->inuse_pages--;
26 +               if (disk->fops->swap_slot_free_notify)
27 +                       disk->fops->swap_slot_free_notify(p->bdev, offset);
28         }
29  
30         return usage;