aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 15:48:55 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 15:48:55 -0400
commitc8d1a126924fcbc1d61ceb830226e0c7afdcc841 (patch)
treed3f3c850481c33b7f433175e83a189f958b1b868 /mm
parentd7dbf4ffee1c7a17e2e5b5f01efe76fbd1671db6 (diff)
parent107c161b7ddeeb7da43509cc6b29211885ccd9af (diff)
Merge staging-next tree into Linus's latest version
Conflicts: drivers/staging/arlan/arlan-main.c drivers/staging/comedi/drivers/cb_das16_cs.c drivers/staging/cx25821/cx25821-alsa.c drivers/staging/dt3155/dt3155_drv.c drivers/staging/hv/hv.c drivers/staging/netwave/netwave_cs.c drivers/staging/wavelan/wavelan.c drivers/staging/wavelan/wavelan_cs.c drivers/staging/wlags49_h2/wl_cs.c This required a bit of hand merging due to the conflicts that happened in the later .34-rc releases, as well as some staging driver changing coming in through other trees (v4l and pcmcia). Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm')
-rw-r--r--mm/swapfile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 6cd0a8f90dc7..f5ccc476aa51 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -574,6 +574,7 @@ static unsigned char swap_entry_free(struct swap_info_struct *p,
574 574
575 /* free if no reference */ 575 /* free if no reference */
576 if (!usage) { 576 if (!usage) {
577 struct gendisk *disk = p->bdev->bd_disk;
577 if (offset < p->lowest_bit) 578 if (offset < p->lowest_bit)
578 p->lowest_bit = offset; 579 p->lowest_bit = offset;
579 if (offset > p->highest_bit) 580 if (offset > p->highest_bit)
@@ -583,6 +584,9 @@ static unsigned char swap_entry_free(struct swap_info_struct *p,
583 swap_list.next = p->type; 584 swap_list.next = p->type;
584 nr_swap_pages++; 585 nr_swap_pages++;
585 p->inuse_pages--; 586 p->inuse_pages--;
587 if ((p->flags & SWP_BLKDEV) &&
588 disk->fops->swap_slot_free_notify)
589 disk->fops->swap_slot_free_notify(p->bdev, offset);
586 } 590 }
587 591
588 return usage; 592 return usage;
@@ -1884,6 +1888,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
1884 if (error < 0) 1888 if (error < 0)
1885 goto bad_swap; 1889 goto bad_swap;
1886 p->bdev = bdev; 1890 p->bdev = bdev;
1891 p->flags |= SWP_BLKDEV;
1887 } else if (S_ISREG(inode->i_mode)) { 1892 } else if (S_ISREG(inode->i_mode)) {
1888 p->bdev = inode->i_sb->s_bdev; 1893 p->bdev = inode->i_sb->s_bdev;
1889 mutex_lock(&inode->i_mutex); 1894 mutex_lock(&inode->i_mutex);