Skip to content

Commit

Permalink
msm7x30: swap patch
Browse files Browse the repository at this point in the history
  • Loading branch information
freexperia committed Jul 11, 2012
1 parent 8293d79 commit 3dba3c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/blkdev.h
Expand Up @@ -1274,6 +1274,7 @@ struct block_device_operations {
unsigned long long);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
struct module *owner;
};

Expand Down
4 changes: 4 additions & 0 deletions mm/swapfile.c
Expand Up @@ -577,6 +577,7 @@ static int swap_entry_free(struct swap_info_struct *p,
count = p->swap_map[offset];
/* free if no reference */
if (!count) {
struct gendisk *disk = p->bdev->bd_disk;
if (offset < p->lowest_bit)
p->lowest_bit = offset;
if (offset > p->highest_bit)
Expand All @@ -585,6 +586,9 @@ static int swap_entry_free(struct swap_info_struct *p,
swap_list.next = p - swap_info;
nr_swap_pages++;
p->inuse_pages--;
if (disk->fops->swap_slot_free_notify)
disk->fops->swap_slot_free_notify(p->bdev,
offset);
}
if (!swap_count(count))
mem_cgroup_uncharge_swap(ent);
Expand Down

0 comments on commit 3dba3c0

Please sign in to comment.