aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 20e58e820e44..40be3ae0afe3 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -47,11 +47,11 @@ static void read_cache_pages_invalidate_page(struct address_space *mapping,
47 if (!trylock_page(page)) 47 if (!trylock_page(page))
48 BUG(); 48 BUG();
49 page->mapping = mapping; 49 page->mapping = mapping;
50 do_invalidatepage(page, 0, PAGE_CACHE_SIZE); 50 do_invalidatepage(page, 0, PAGE_SIZE);
51 page->mapping = NULL; 51 page->mapping = NULL;
52 unlock_page(page); 52 unlock_page(page);
53 } 53 }
54 page_cache_release(page); 54 put_page(page);
55} 55}
56 56
57/* 57/*
@@ -93,14 +93,14 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages,
93 read_cache_pages_invalidate_page(mapping, page); 93 read_cache_pages_invalidate_page(mapping, page);
94 continue; 94 continue;
95 } 95 }
96 page_cache_release(page); 96 put_page(page);
97 97
98 ret = filler(data, page); 98 ret = filler(data, page);
99 if (unlikely(ret)) { 99 if (unlikely(ret)) {
100 read_cache_pages_invalidate_pages(mapping, pages); 100 read_cache_pages_invalidate_pages(mapping, pages);
101 break; 101 break;
102 } 102 }
103 task_io_account_read(PAGE_CACHE_SIZE); 103 task_io_account_read(PAGE_SIZE);
104 } 104 }
105 return ret; 105 return ret;
106} 106}
@@ -130,7 +130,7 @@ static int read_pages(struct address_space *mapping, struct file *filp,
130 mapping_gfp_constraint(mapping, GFP_KERNEL))) { 130 mapping_gfp_constraint(mapping, GFP_KERNEL))) {
131 mapping->a_ops->readpage(filp, page); 131 mapping->a_ops->readpage(filp, page);
132 } 132 }
133 page_cache_release(page); 133 put_page(page);
134 } 134 }
135 ret = 0; 135 ret = 0;
136 136
@@ -163,7 +163,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
163 if (isize == 0) 163 if (isize == 0)
164 goto out; 164 goto out;
165 165
166 end_index = ((isize - 1) >> PAGE_CACHE_SHIFT); 166 end_index = ((isize - 1) >> PAGE_SHIFT);
167 167
168 /* 168 /*
169 * Preallocate as many pages as we will need. 169 * Preallocate as many pages as we will need.
@@ -216,7 +216,7 @@ int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
216 while (nr_to_read) { 216 while (nr_to_read) {
217 int err; 217 int err;
218 218
219 unsigned long this_chunk = (2 * 1024 * 1024) / PAGE_CACHE_SIZE; 219 unsigned long this_chunk = (2 * 1024 * 1024) / PAGE_SIZE;
220 220
221 if (this_chunk > nr_to_read) 221 if (this_chunk > nr_to_read)
222 this_chunk = nr_to_read; 222 this_chunk = nr_to_read;
@@ -425,7 +425,7 @@ ondemand_readahead(struct address_space *mapping,
425 * trivial case: (offset - prev_offset) == 1 425 * trivial case: (offset - prev_offset) == 1
426 * unaligned reads: (offset - prev_offset) == 0 426 * unaligned reads: (offset - prev_offset) == 0
427 */ 427 */
428 prev_offset = (unsigned long long)ra->prev_pos >> PAGE_CACHE_SHIFT; 428 prev_offset = (unsigned long long)ra->prev_pos >> PAGE_SHIFT;
429 if (offset - prev_offset <= 1UL) 429 if (offset - prev_offset <= 1UL)
430 goto initial_readahead; 430 goto initial_readahead;
431 431
@@ -558,8 +558,8 @@ SYSCALL_DEFINE3(readahead, int, fd, loff_t, offset, size_t, count)
558 if (f.file) { 558 if (f.file) {
559 if (f.file->f_mode & FMODE_READ) { 559 if (f.file->f_mode & FMODE_READ) {
560 struct address_space *mapping = f.file->f_mapping; 560 struct address_space *mapping = f.file->f_mapping;
561 pgoff_t start = offset >> PAGE_CACHE_SHIFT; 561 pgoff_t start = offset >> PAGE_SHIFT;
562 pgoff_t end = (offset + count - 1) >> PAGE_CACHE_SHIFT; 562 pgoff_t end = (offset + count - 1) >> PAGE_SHIFT;
563 unsigned long len = end - start + 1; 563 unsigned long len = end - start + 1;
564 ret = do_readahead(mapping, f.file, start, len); 564 ret = do_readahead(mapping, f.file, start, len);
565 } 565 }