Clean up patch dir; synchronize patches with kernel-power v48
[kernel-bfs] / kernel-bfs-2.6.28 / debian / patches / patch_swap_notify_core_support_2.6.28.diff
index d681471..2a66eb1 100644 (file)
@@ -61,7 +61,7 @@ diff -uprN linux-2.6.28/mm/swapfile.c linux-2.6.28.new/mm/swapfile.c
  
        if (count >= SWAP_MAP_MAX)
                return count;
-@@ -283,28 +295,39 @@ static int swap_entry_free(struct swap_i
+@@ -283,28 +296,40 @@ static int swap_entry_free(struct swap_i
        if (count)
                return count;
  
@@ -76,15 +76,16 @@ diff -uprN linux-2.6.28/mm/swapfile.c linux-2.6.28.new/mm/swapfile.c
 -              swap_list.next = p - swap_info;
 -      nr_swap_pages++;
 -      p->inuse_pages--;
-+      if (!p->swap_remap) {
++      if (p->swap_remap) {
++              spin_lock(&p->remap_lock);
++              swap_entry_update(p, offset);
++      }
++      else {
 +              swap_entry_update(p, offset);
 +              if (disk->fops->swap_slot_free_notify)
 +                      disk->fops->swap_slot_free_notify(p->bdev, offset);
 +              return 0;
 +      }
-+
-+      spin_lock(&p->remap_lock);
-+      swap_entry_update(p, offset);
  
        /* Re-map the page number */
        old = p->swap_remap[offset] & 0x7FFFFFFF;