diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/rmap.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1512,7 +1512,7 @@ static int try_to_unmap_anon(struct page *page, enum ttu_flags flags) | |||
1512 | static int try_to_unmap_file(struct page *page, enum ttu_flags flags) | 1512 | static int try_to_unmap_file(struct page *page, enum ttu_flags flags) |
1513 | { | 1513 | { |
1514 | struct address_space *mapping = page->mapping; | 1514 | struct address_space *mapping = page->mapping; |
1515 | pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | 1515 | pgoff_t pgoff = page->index << compound_order(page); |
1516 | struct vm_area_struct *vma; | 1516 | struct vm_area_struct *vma; |
1517 | int ret = SWAP_AGAIN; | 1517 | int ret = SWAP_AGAIN; |
1518 | unsigned long cursor; | 1518 | unsigned long cursor; |
@@ -1520,9 +1520,6 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags) | |||
1520 | unsigned long max_nl_size = 0; | 1520 | unsigned long max_nl_size = 0; |
1521 | unsigned int mapcount; | 1521 | unsigned int mapcount; |
1522 | 1522 | ||
1523 | if (PageHuge(page)) | ||
1524 | pgoff = page->index << compound_order(page); | ||
1525 | |||
1526 | mutex_lock(&mapping->i_mmap_mutex); | 1523 | mutex_lock(&mapping->i_mmap_mutex); |
1527 | vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { | 1524 | vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { |
1528 | unsigned long address = vma_address(page, vma); | 1525 | unsigned long address = vma_address(page, vma); |
@@ -1712,7 +1709,7 @@ static int rmap_walk_file(struct page *page, int (*rmap_one)(struct page *, | |||
1712 | struct vm_area_struct *, unsigned long, void *), void *arg) | 1709 | struct vm_area_struct *, unsigned long, void *), void *arg) |
1713 | { | 1710 | { |
1714 | struct address_space *mapping = page->mapping; | 1711 | struct address_space *mapping = page->mapping; |
1715 | pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | 1712 | pgoff_t pgoff = page->index << compound_order(page); |
1716 | struct vm_area_struct *vma; | 1713 | struct vm_area_struct *vma; |
1717 | int ret = SWAP_AGAIN; | 1714 | int ret = SWAP_AGAIN; |
1718 | 1715 | ||