diff options
Diffstat (limited to 'fs/ext4/readpage.c')
-rw-r--r-- | fs/ext4/readpage.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 5dc5e95063de..dc54a4b60eba 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * | 23 | * |
24 | * then this code just gives up and calls the buffer_head-based read function. | 24 | * then this code just gives up and calls the buffer_head-based read function. |
25 | * It does handle a page which has holes at the end - that is a common case: | 25 | * It does handle a page which has holes at the end - that is a common case: |
26 | * the end-of-file on blocksize < PAGE_CACHE_SIZE setups. | 26 | * the end-of-file on blocksize < PAGE_SIZE setups. |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
@@ -140,7 +140,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
140 | 140 | ||
141 | struct inode *inode = mapping->host; | 141 | struct inode *inode = mapping->host; |
142 | const unsigned blkbits = inode->i_blkbits; | 142 | const unsigned blkbits = inode->i_blkbits; |
143 | const unsigned blocks_per_page = PAGE_CACHE_SIZE >> blkbits; | 143 | const unsigned blocks_per_page = PAGE_SIZE >> blkbits; |
144 | const unsigned blocksize = 1 << blkbits; | 144 | const unsigned blocksize = 1 << blkbits; |
145 | sector_t block_in_file; | 145 | sector_t block_in_file; |
146 | sector_t last_block; | 146 | sector_t last_block; |
@@ -173,7 +173,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
173 | if (page_has_buffers(page)) | 173 | if (page_has_buffers(page)) |
174 | goto confused; | 174 | goto confused; |
175 | 175 | ||
176 | block_in_file = (sector_t)page->index << (PAGE_CACHE_SHIFT - blkbits); | 176 | block_in_file = (sector_t)page->index << (PAGE_SHIFT - blkbits); |
177 | last_block = block_in_file + nr_pages * blocks_per_page; | 177 | last_block = block_in_file + nr_pages * blocks_per_page; |
178 | last_block_in_file = (i_size_read(inode) + blocksize - 1) >> blkbits; | 178 | last_block_in_file = (i_size_read(inode) + blocksize - 1) >> blkbits; |
179 | if (last_block > last_block_in_file) | 179 | if (last_block > last_block_in_file) |
@@ -217,7 +217,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
217 | set_error_page: | 217 | set_error_page: |
218 | SetPageError(page); | 218 | SetPageError(page); |
219 | zero_user_segment(page, 0, | 219 | zero_user_segment(page, 0, |
220 | PAGE_CACHE_SIZE); | 220 | PAGE_SIZE); |
221 | unlock_page(page); | 221 | unlock_page(page); |
222 | goto next_page; | 222 | goto next_page; |
223 | } | 223 | } |
@@ -250,7 +250,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
250 | } | 250 | } |
251 | if (first_hole != blocks_per_page) { | 251 | if (first_hole != blocks_per_page) { |
252 | zero_user_segment(page, first_hole << blkbits, | 252 | zero_user_segment(page, first_hole << blkbits, |
253 | PAGE_CACHE_SIZE); | 253 | PAGE_SIZE); |
254 | if (first_hole == 0) { | 254 | if (first_hole == 0) { |
255 | SetPageUptodate(page); | 255 | SetPageUptodate(page); |
256 | unlock_page(page); | 256 | unlock_page(page); |
@@ -279,7 +279,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
279 | 279 | ||
280 | if (ext4_encrypted_inode(inode) && | 280 | if (ext4_encrypted_inode(inode) && |
281 | S_ISREG(inode->i_mode)) { | 281 | S_ISREG(inode->i_mode)) { |
282 | ctx = ext4_get_crypto_ctx(inode); | 282 | ctx = ext4_get_crypto_ctx(inode, GFP_NOFS); |
283 | if (IS_ERR(ctx)) | 283 | if (IS_ERR(ctx)) |
284 | goto set_error_page; | 284 | goto set_error_page; |
285 | } | 285 | } |
@@ -319,7 +319,7 @@ int ext4_mpage_readpages(struct address_space *mapping, | |||
319 | unlock_page(page); | 319 | unlock_page(page); |
320 | next_page: | 320 | next_page: |
321 | if (pages) | 321 | if (pages) |
322 | page_cache_release(page); | 322 | put_page(page); |
323 | } | 323 | } |
324 | BUG_ON(pages && !list_empty(pages)); | 324 | BUG_ON(pages && !list_empty(pages)); |
325 | if (bio) | 325 | if (bio) |