@@ -1757,7 +1757,7 @@ static int rmap_walk_anon(struct page *page, struct rmap_walk_control *rwc,
1757
1757
bool locked )
1758
1758
{
1759
1759
struct anon_vma * anon_vma ;
1760
- pgoff_t pgoff ;
1760
+ pgoff_t pgoff_start , pgoff_end ;
1761
1761
struct anon_vma_chain * avc ;
1762
1762
int ret = SWAP_AGAIN ;
1763
1763
@@ -1771,8 +1771,10 @@ static int rmap_walk_anon(struct page *page, struct rmap_walk_control *rwc,
1771
1771
if (!anon_vma )
1772
1772
return ret ;
1773
1773
1774
- pgoff = page_to_pgoff (page );
1775
- anon_vma_interval_tree_foreach (avc , & anon_vma -> rb_root , pgoff , pgoff ) {
1774
+ pgoff_start = page_to_pgoff (page );
1775
+ pgoff_end = pgoff_start + hpage_nr_pages (page ) - 1 ;
1776
+ anon_vma_interval_tree_foreach (avc , & anon_vma -> rb_root ,
1777
+ pgoff_start , pgoff_end ) {
1776
1778
struct vm_area_struct * vma = avc -> vma ;
1777
1779
unsigned long address = vma_address (page , vma );
1778
1780
@@ -1810,7 +1812,7 @@ static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc,
1810
1812
bool locked )
1811
1813
{
1812
1814
struct address_space * mapping = page_mapping (page );
1813
- pgoff_t pgoff ;
1815
+ pgoff_t pgoff_start , pgoff_end ;
1814
1816
struct vm_area_struct * vma ;
1815
1817
int ret = SWAP_AGAIN ;
1816
1818
@@ -1825,10 +1827,12 @@ static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc,
1825
1827
if (!mapping )
1826
1828
return ret ;
1827
1829
1828
- pgoff = page_to_pgoff (page );
1830
+ pgoff_start = page_to_pgoff (page );
1831
+ pgoff_end = pgoff_start + hpage_nr_pages (page ) - 1 ;
1829
1832
if (!locked )
1830
1833
i_mmap_lock_read (mapping );
1831
- vma_interval_tree_foreach (vma , & mapping -> i_mmap , pgoff , pgoff ) {
1834
+ vma_interval_tree_foreach (vma , & mapping -> i_mmap ,
1835
+ pgoff_start , pgoff_end ) {
1832
1836
unsigned long address = vma_address (page , vma );
1833
1837
1834
1838
cond_resched ();
0 commit comments