diff options
Diffstat (limited to 'fs/squashfs/file.c')
-rw-r--r-- | fs/squashfs/file.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index e5c9689062ba..13d80947bf9e 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c | |||
@@ -175,7 +175,7 @@ static long long read_indexes(struct super_block *sb, int n, | |||
175 | { | 175 | { |
176 | int err, i; | 176 | int err, i; |
177 | long long block = 0; | 177 | long long block = 0; |
178 | __le32 *blist = kmalloc(PAGE_CACHE_SIZE, GFP_KERNEL); | 178 | __le32 *blist = kmalloc(PAGE_SIZE, GFP_KERNEL); |
179 | 179 | ||
180 | if (blist == NULL) { | 180 | if (blist == NULL) { |
181 | ERROR("read_indexes: Failed to allocate block_list\n"); | 181 | ERROR("read_indexes: Failed to allocate block_list\n"); |
@@ -183,7 +183,7 @@ static long long read_indexes(struct super_block *sb, int n, | |||
183 | } | 183 | } |
184 | 184 | ||
185 | while (n) { | 185 | while (n) { |
186 | int blocks = min_t(int, n, PAGE_CACHE_SIZE >> 2); | 186 | int blocks = min_t(int, n, PAGE_SIZE >> 2); |
187 | 187 | ||
188 | err = squashfs_read_metadata(sb, blist, start_block, | 188 | err = squashfs_read_metadata(sb, blist, start_block, |
189 | offset, blocks << 2); | 189 | offset, blocks << 2); |
@@ -377,19 +377,19 @@ void squashfs_copy_cache(struct page *page, struct squashfs_cache_entry *buffer, | |||
377 | struct inode *inode = page->mapping->host; | 377 | struct inode *inode = page->mapping->host; |
378 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; | 378 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; |
379 | void *pageaddr; | 379 | void *pageaddr; |
380 | int i, mask = (1 << (msblk->block_log - PAGE_CACHE_SHIFT)) - 1; | 380 | int i, mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1; |
381 | int start_index = page->index & ~mask, end_index = start_index | mask; | 381 | int start_index = page->index & ~mask, end_index = start_index | mask; |
382 | 382 | ||
383 | /* | 383 | /* |
384 | * Loop copying datablock into pages. As the datablock likely covers | 384 | * Loop copying datablock into pages. As the datablock likely covers |
385 | * many PAGE_CACHE_SIZE pages (default block size is 128 KiB) explicitly | 385 | * many PAGE_SIZE pages (default block size is 128 KiB) explicitly |
386 | * grab the pages from the page cache, except for the page that we've | 386 | * grab the pages from the page cache, except for the page that we've |
387 | * been called to fill. | 387 | * been called to fill. |
388 | */ | 388 | */ |
389 | for (i = start_index; i <= end_index && bytes > 0; i++, | 389 | for (i = start_index; i <= end_index && bytes > 0; i++, |
390 | bytes -= PAGE_CACHE_SIZE, offset += PAGE_CACHE_SIZE) { | 390 | bytes -= PAGE_SIZE, offset += PAGE_SIZE) { |
391 | struct page *push_page; | 391 | struct page *push_page; |
392 | int avail = buffer ? min_t(int, bytes, PAGE_CACHE_SIZE) : 0; | 392 | int avail = buffer ? min_t(int, bytes, PAGE_SIZE) : 0; |
393 | 393 | ||
394 | TRACE("bytes %d, i %d, available_bytes %d\n", bytes, i, avail); | 394 | TRACE("bytes %d, i %d, available_bytes %d\n", bytes, i, avail); |
395 | 395 | ||
@@ -404,14 +404,14 @@ void squashfs_copy_cache(struct page *page, struct squashfs_cache_entry *buffer, | |||
404 | 404 | ||
405 | pageaddr = kmap_atomic(push_page); | 405 | pageaddr = kmap_atomic(push_page); |
406 | squashfs_copy_data(pageaddr, buffer, offset, avail); | 406 | squashfs_copy_data(pageaddr, buffer, offset, avail); |
407 | memset(pageaddr + avail, 0, PAGE_CACHE_SIZE - avail); | 407 | memset(pageaddr + avail, 0, PAGE_SIZE - avail); |
408 | kunmap_atomic(pageaddr); | 408 | kunmap_atomic(pageaddr); |
409 | flush_dcache_page(push_page); | 409 | flush_dcache_page(push_page); |
410 | SetPageUptodate(push_page); | 410 | SetPageUptodate(push_page); |
411 | skip_page: | 411 | skip_page: |
412 | unlock_page(push_page); | 412 | unlock_page(push_page); |
413 | if (i != page->index) | 413 | if (i != page->index) |
414 | page_cache_release(push_page); | 414 | put_page(push_page); |
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
@@ -454,7 +454,7 @@ static int squashfs_readpage(struct file *file, struct page *page) | |||
454 | { | 454 | { |
455 | struct inode *inode = page->mapping->host; | 455 | struct inode *inode = page->mapping->host; |
456 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; | 456 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; |
457 | int index = page->index >> (msblk->block_log - PAGE_CACHE_SHIFT); | 457 | int index = page->index >> (msblk->block_log - PAGE_SHIFT); |
458 | int file_end = i_size_read(inode) >> msblk->block_log; | 458 | int file_end = i_size_read(inode) >> msblk->block_log; |
459 | int res; | 459 | int res; |
460 | void *pageaddr; | 460 | void *pageaddr; |
@@ -462,8 +462,8 @@ static int squashfs_readpage(struct file *file, struct page *page) | |||
462 | TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", | 462 | TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", |
463 | page->index, squashfs_i(inode)->start); | 463 | page->index, squashfs_i(inode)->start); |
464 | 464 | ||
465 | if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> | 465 | if (page->index >= ((i_size_read(inode) + PAGE_SIZE - 1) >> |
466 | PAGE_CACHE_SHIFT)) | 466 | PAGE_SHIFT)) |
467 | goto out; | 467 | goto out; |
468 | 468 | ||
469 | if (index < file_end || squashfs_i(inode)->fragment_block == | 469 | if (index < file_end || squashfs_i(inode)->fragment_block == |
@@ -487,7 +487,7 @@ error_out: | |||
487 | SetPageError(page); | 487 | SetPageError(page); |
488 | out: | 488 | out: |
489 | pageaddr = kmap_atomic(page); | 489 | pageaddr = kmap_atomic(page); |
490 | memset(pageaddr, 0, PAGE_CACHE_SIZE); | 490 | memset(pageaddr, 0, PAGE_SIZE); |
491 | kunmap_atomic(pageaddr); | 491 | kunmap_atomic(pageaddr); |
492 | flush_dcache_page(page); | 492 | flush_dcache_page(page); |
493 | if (!PageError(page)) | 493 | if (!PageError(page)) |