aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2011-11-25 10:14:39 -0500
committerCong Wang <xiyou.wangcong@gmail.com>2012-03-20 09:48:27 -0400
commit9b04c5fec43c0da610a2c37f70c5b013101a6ad7 (patch)
treef04767281b7067fba91cf0d37440bf454c492e38 /mm/swapfile.c
parentc3eede8e0a1292d95c051cf947738687b9c42322 (diff)
mm: remove the second argument of k[un]map_atomic()
Signed-off-by: Cong Wang <amwang@redhat.com>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d999f090dfda..00a962caab1a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2427,9 +2427,9 @@ int add_swap_count_continuation(swp_entry_t entry, gfp_t gfp_mask)
2427 if (!(count & COUNT_CONTINUED)) 2427 if (!(count & COUNT_CONTINUED))
2428 goto out; 2428 goto out;
2429 2429
2430 map = kmap_atomic(list_page, KM_USER0) + offset; 2430 map = kmap_atomic(list_page) + offset;
2431 count = *map; 2431 count = *map;
2432 kunmap_atomic(map, KM_USER0); 2432 kunmap_atomic(map);
2433 2433
2434 /* 2434 /*
2435 * If this continuation count now has some space in it, 2435 * If this continuation count now has some space in it,
@@ -2472,7 +2472,7 @@ static bool swap_count_continued(struct swap_info_struct *si,
2472 2472
2473 offset &= ~PAGE_MASK; 2473 offset &= ~PAGE_MASK;
2474 page = list_entry(head->lru.next, struct page, lru); 2474 page = list_entry(head->lru.next, struct page, lru);
2475 map = kmap_atomic(page, KM_USER0) + offset; 2475 map = kmap_atomic(page) + offset;
2476 2476
2477 if (count == SWAP_MAP_MAX) /* initial increment from swap_map */ 2477 if (count == SWAP_MAP_MAX) /* initial increment from swap_map */
2478 goto init_map; /* jump over SWAP_CONT_MAX checks */ 2478 goto init_map; /* jump over SWAP_CONT_MAX checks */
@@ -2482,26 +2482,26 @@ static bool swap_count_continued(struct swap_info_struct *si,
2482 * Think of how you add 1 to 999 2482 * Think of how you add 1 to 999
2483 */ 2483 */
2484 while (*map == (SWAP_CONT_MAX | COUNT_CONTINUED)) { 2484 while (*map == (SWAP_CONT_MAX | COUNT_CONTINUED)) {
2485 kunmap_atomic(map, KM_USER0); 2485 kunmap_atomic(map);
2486 page = list_entry(page->lru.next, struct page, lru); 2486 page = list_entry(page->lru.next, struct page, lru);
2487 BUG_ON(page == head); 2487 BUG_ON(page == head);
2488 map = kmap_atomic(page, KM_USER0) + offset; 2488 map = kmap_atomic(page) + offset;
2489 } 2489 }
2490 if (*map == SWAP_CONT_MAX) { 2490 if (*map == SWAP_CONT_MAX) {
2491 kunmap_atomic(map, KM_USER0); 2491 kunmap_atomic(map);
2492 page = list_entry(page->lru.next, struct page, lru); 2492 page = list_entry(page->lru.next, struct page, lru);
2493 if (page == head) 2493 if (page == head)
2494 return false; /* add count continuation */ 2494 return false; /* add count continuation */
2495 map = kmap_atomic(page, KM_USER0) + offset; 2495 map = kmap_atomic(page) + offset;
2496init_map: *map = 0; /* we didn't zero the page */ 2496init_map: *map = 0; /* we didn't zero the page */
2497 } 2497 }
2498 *map += 1; 2498 *map += 1;
2499 kunmap_atomic(map, KM_USER0); 2499 kunmap_atomic(map);
2500 page = list_entry(page->lru.prev, struct page, lru); 2500 page = list_entry(page->lru.prev, struct page, lru);
2501 while (page != head) { 2501 while (page != head) {
2502 map = kmap_atomic(page, KM_USER0) + offset; 2502 map = kmap_atomic(page) + offset;
2503 *map = COUNT_CONTINUED; 2503 *map = COUNT_CONTINUED;
2504 kunmap_atomic(map, KM_USER0); 2504 kunmap_atomic(map);
2505 page = list_entry(page->lru.prev, struct page, lru); 2505 page = list_entry(page->lru.prev, struct page, lru);
2506 } 2506 }
2507 return true; /* incremented */ 2507 return true; /* incremented */
@@ -2512,22 +2512,22 @@ init_map: *map = 0; /* we didn't zero the page */
2512 */ 2512 */
2513 BUG_ON(count != COUNT_CONTINUED); 2513 BUG_ON(count != COUNT_CONTINUED);
2514 while (*map == COUNT_CONTINUED) { 2514 while (*map == COUNT_CONTINUED) {
2515 kunmap_atomic(map, KM_USER0); 2515 kunmap_atomic(map);
2516 page = list_entry(page->lru.next, struct page, lru); 2516 page = list_entry(page->lru.next, struct page, lru);
2517 BUG_ON(page == head); 2517 BUG_ON(page == head);
2518 map = kmap_atomic(page, KM_USER0) + offset; 2518 map = kmap_atomic(page) + offset;
2519 } 2519 }
2520 BUG_ON(*map == 0); 2520 BUG_ON(*map == 0);
2521 *map -= 1; 2521 *map -= 1;
2522 if (*map == 0) 2522 if (*map == 0)
2523 count = 0; 2523 count = 0;
2524 kunmap_atomic(map, KM_USER0); 2524 kunmap_atomic(map);
2525 page = list_entry(page->lru.prev, struct page, lru); 2525 page = list_entry(page->lru.prev, struct page, lru);
2526 while (page != head) { 2526 while (page != head) {
2527 map = kmap_atomic(page, KM_USER0) + offset; 2527 map = kmap_atomic(page) + offset;
2528 *map = SWAP_CONT_MAX | count; 2528 *map = SWAP_CONT_MAX | count;
2529 count = COUNT_CONTINUED; 2529 count = COUNT_CONTINUED;
2530 kunmap_atomic(map, KM_USER0); 2530 kunmap_atomic(map);
2531 page = list_entry(page->lru.prev, struct page, lru); 2531 page = list_entry(page->lru.prev, struct page, lru);
2532 } 2532 }
2533 return count == COUNT_CONTINUED; 2533 return count == COUNT_CONTINUED;