aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/swapfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 763210732b5f..6a078557306a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -96,7 +96,7 @@ static int discard_swap(struct swap_info_struct *si)
96 96
97 list_for_each_entry(se, &si->extent_list, list) { 97 list_for_each_entry(se, &si->extent_list, list) {
98 sector_t start_block = se->start_block << (PAGE_SHIFT - 9); 98 sector_t start_block = se->start_block << (PAGE_SHIFT - 9);
99 pgoff_t nr_blocks = se->nr_pages << (PAGE_SHIFT - 9); 99 sector_t nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9);
100 100
101 if (se->start_page == 0) { 101 if (se->start_page == 0) {
102 /* Do not discard the swap header page! */ 102 /* Do not discard the swap header page! */
@@ -133,7 +133,7 @@ static void discard_swap_cluster(struct swap_info_struct *si,
133 start_page < se->start_page + se->nr_pages) { 133 start_page < se->start_page + se->nr_pages) {
134 pgoff_t offset = start_page - se->start_page; 134 pgoff_t offset = start_page - se->start_page;
135 sector_t start_block = se->start_block + offset; 135 sector_t start_block = se->start_block + offset;
136 pgoff_t nr_blocks = se->nr_pages - offset; 136 sector_t nr_blocks = se->nr_pages - offset;
137 137
138 if (nr_blocks > nr_pages) 138 if (nr_blocks > nr_pages)
139 nr_blocks = nr_pages; 139 nr_blocks = nr_pages;