aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-04-19 08:29:38 -0400
committerDavid Sterba <dsterba@suse.cz>2011-05-02 07:57:19 -0400
commit306e16ce13c0f3d4fc071b45803b5b83c2606011 (patch)
tree109aa42ae17d91429d11ab332e0c16e790f95dc5 /fs/btrfs/compression.c
parent3fd9952df4964fac7d5868ba48eadcc9dae3ba46 (diff)
btrfs: rename variables clashing with global function names
reported by gcc -Wshadow: page_index, page_offset, new_inode, dev_name Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 41d1d7c70e29..d4cd0f0cd695 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -332,7 +332,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
332 struct compressed_bio *cb; 332 struct compressed_bio *cb;
333 unsigned long bytes_left; 333 unsigned long bytes_left;
334 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; 334 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
335 int page_index = 0; 335 int pg_index = 0;
336 struct page *page; 336 struct page *page;
337 u64 first_byte = disk_start; 337 u64 first_byte = disk_start;
338 struct block_device *bdev; 338 struct block_device *bdev;
@@ -366,8 +366,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
366 366
367 /* create and submit bios for the compressed pages */ 367 /* create and submit bios for the compressed pages */
368 bytes_left = compressed_len; 368 bytes_left = compressed_len;
369 for (page_index = 0; page_index < cb->nr_pages; page_index++) { 369 for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) {
370 page = compressed_pages[page_index]; 370 page = compressed_pages[pg_index];
371 page->mapping = inode->i_mapping; 371 page->mapping = inode->i_mapping;
372 if (bio->bi_size) 372 if (bio->bi_size)
373 ret = io_tree->ops->merge_bio_hook(page, 0, 373 ret = io_tree->ops->merge_bio_hook(page, 0,
@@ -432,7 +432,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
432 struct compressed_bio *cb) 432 struct compressed_bio *cb)
433{ 433{
434 unsigned long end_index; 434 unsigned long end_index;
435 unsigned long page_index; 435 unsigned long pg_index;
436 u64 last_offset; 436 u64 last_offset;
437 u64 isize = i_size_read(inode); 437 u64 isize = i_size_read(inode);
438 int ret; 438 int ret;
@@ -456,13 +456,13 @@ static noinline int add_ra_bio_pages(struct inode *inode,
456 end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; 456 end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT;
457 457
458 while (last_offset < compressed_end) { 458 while (last_offset < compressed_end) {
459 page_index = last_offset >> PAGE_CACHE_SHIFT; 459 pg_index = last_offset >> PAGE_CACHE_SHIFT;
460 460
461 if (page_index > end_index) 461 if (pg_index > end_index)
462 break; 462 break;
463 463
464 rcu_read_lock(); 464 rcu_read_lock();
465 page = radix_tree_lookup(&mapping->page_tree, page_index); 465 page = radix_tree_lookup(&mapping->page_tree, pg_index);
466 rcu_read_unlock(); 466 rcu_read_unlock();
467 if (page) { 467 if (page) {
468 misses++; 468 misses++;
@@ -476,7 +476,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
476 if (!page) 476 if (!page)
477 break; 477 break;
478 478
479 if (add_to_page_cache_lru(page, mapping, page_index, 479 if (add_to_page_cache_lru(page, mapping, pg_index,
480 GFP_NOFS)) { 480 GFP_NOFS)) {
481 page_cache_release(page); 481 page_cache_release(page);
482 goto next; 482 goto next;
@@ -560,7 +560,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
560 unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; 560 unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE;
561 unsigned long compressed_len; 561 unsigned long compressed_len;
562 unsigned long nr_pages; 562 unsigned long nr_pages;
563 unsigned long page_index; 563 unsigned long pg_index;
564 struct page *page; 564 struct page *page;
565 struct block_device *bdev; 565 struct block_device *bdev;
566 struct bio *comp_bio; 566 struct bio *comp_bio;
@@ -613,10 +613,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
613 613
614 bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; 614 bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev;
615 615
616 for (page_index = 0; page_index < nr_pages; page_index++) { 616 for (pg_index = 0; pg_index < nr_pages; pg_index++) {
617 cb->compressed_pages[page_index] = alloc_page(GFP_NOFS | 617 cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS |
618 __GFP_HIGHMEM); 618 __GFP_HIGHMEM);
619 if (!cb->compressed_pages[page_index]) 619 if (!cb->compressed_pages[pg_index])
620 goto fail2; 620 goto fail2;
621 } 621 }
622 cb->nr_pages = nr_pages; 622 cb->nr_pages = nr_pages;
@@ -634,8 +634,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
634 comp_bio->bi_end_io = end_compressed_bio_read; 634 comp_bio->bi_end_io = end_compressed_bio_read;
635 atomic_inc(&cb->pending_bios); 635 atomic_inc(&cb->pending_bios);
636 636
637 for (page_index = 0; page_index < nr_pages; page_index++) { 637 for (pg_index = 0; pg_index < nr_pages; pg_index++) {
638 page = cb->compressed_pages[page_index]; 638 page = cb->compressed_pages[pg_index];
639 page->mapping = inode->i_mapping; 639 page->mapping = inode->i_mapping;
640 page->index = em_start >> PAGE_CACHE_SHIFT; 640 page->index = em_start >> PAGE_CACHE_SHIFT;
641 641
@@ -702,8 +702,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
702 return 0; 702 return 0;
703 703
704fail2: 704fail2:
705 for (page_index = 0; page_index < nr_pages; page_index++) 705 for (pg_index = 0; pg_index < nr_pages; pg_index++)
706 free_page((unsigned long)cb->compressed_pages[page_index]); 706 free_page((unsigned long)cb->compressed_pages[pg_index]);
707 707
708 kfree(cb->compressed_pages); 708 kfree(cb->compressed_pages);
709fail1: 709fail1:
@@ -945,7 +945,7 @@ void btrfs_exit_compress(void)
945int btrfs_decompress_buf2page(char *buf, unsigned long buf_start, 945int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
946 unsigned long total_out, u64 disk_start, 946 unsigned long total_out, u64 disk_start,
947 struct bio_vec *bvec, int vcnt, 947 struct bio_vec *bvec, int vcnt,
948 unsigned long *page_index, 948 unsigned long *pg_index,
949 unsigned long *pg_offset) 949 unsigned long *pg_offset)
950{ 950{
951 unsigned long buf_offset; 951 unsigned long buf_offset;
@@ -954,7 +954,7 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
954 unsigned long working_bytes = total_out - buf_start; 954 unsigned long working_bytes = total_out - buf_start;
955 unsigned long bytes; 955 unsigned long bytes;
956 char *kaddr; 956 char *kaddr;
957 struct page *page_out = bvec[*page_index].bv_page; 957 struct page *page_out = bvec[*pg_index].bv_page;
958 958
959 /* 959 /*
960 * start byte is the first byte of the page we're currently 960 * start byte is the first byte of the page we're currently
@@ -995,11 +995,11 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
995 995
996 /* check if we need to pick another page */ 996 /* check if we need to pick another page */
997 if (*pg_offset == PAGE_CACHE_SIZE) { 997 if (*pg_offset == PAGE_CACHE_SIZE) {
998 (*page_index)++; 998 (*pg_index)++;
999 if (*page_index >= vcnt) 999 if (*pg_index >= vcnt)
1000 return 0; 1000 return 0;
1001 1001
1002 page_out = bvec[*page_index].bv_page; 1002 page_out = bvec[*pg_index].bv_page;
1003 *pg_offset = 0; 1003 *pg_offset = 0;
1004 start_byte = page_offset(page_out) - disk_start; 1004 start_byte = page_offset(page_out) - disk_start;
1005 1005