diff options
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index ecb069e213d0..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; |