diff options
38 files changed, 295 insertions, 3234 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 44ea5b92e1ba..f66fc9959733 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode) | |||
| 288 | return 0; | 288 | return 0; |
| 289 | 289 | ||
| 290 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); | 290 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); |
| 291 | if (IS_ERR(acl) || !acl) | 291 | if (IS_ERR_OR_NULL(acl)) |
| 292 | return PTR_ERR(acl); | 292 | return PTR_ERR(acl); |
| 293 | 293 | ||
| 294 | clone = posix_acl_clone(acl, GFP_KERNEL); | 294 | clone = posix_acl_clone(acl, GFP_KERNEL); |
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 369d5068ac7a..bfe42b03eaf9 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
| @@ -333,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 333 | struct compressed_bio *cb; | 333 | struct compressed_bio *cb; |
| 334 | unsigned long bytes_left; | 334 | unsigned long bytes_left; |
| 335 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 335 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
| 336 | int page_index = 0; | 336 | int pg_index = 0; |
| 337 | struct page *page; | 337 | struct page *page; |
| 338 | u64 first_byte = disk_start; | 338 | u64 first_byte = disk_start; |
| 339 | struct block_device *bdev; | 339 | struct block_device *bdev; |
| @@ -367,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
| 367 | 367 | ||
| 368 | /* create and submit bios for the compressed pages */ | 368 | /* create and submit bios for the compressed pages */ |
| 369 | bytes_left = compressed_len; | 369 | bytes_left = compressed_len; |
| 370 | for (page_index = 0; page_index < cb->nr_pages; page_index++) { | 370 | for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { |
| 371 | page = compressed_pages[page_index]; | 371 | page = compressed_pages[pg_index]; |
| 372 | page->mapping = inode->i_mapping; | 372 | page->mapping = inode->i_mapping; |
| 373 | if (bio->bi_size) | 373 | if (bio->bi_size) |
| 374 | ret = io_tree->ops->merge_bio_hook(page, 0, | 374 | ret = io_tree->ops->merge_bio_hook(page, 0, |
| @@ -433,7 +433,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, | |||
| 433 | struct compressed_bio *cb) | 433 | struct compressed_bio *cb) |
| 434 | { | 434 | { |
| 435 | unsigned long end_index; | 435 | unsigned long end_index; |
| 436 | unsigned long page_index; | 436 | unsigned long pg_index; |
| 437 | u64 last_offset; | 437 | u64 last_offset; |
| 438 | u64 isize = i_size_read(inode); | 438 | u64 isize = i_size_read(inode); |
| 439 | int ret; | 439 | int ret; |
| @@ -457,13 +457,13 @@ static noinline int add_ra_bio_pages(struct inode *inode, | |||
| 457 | end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; | 457 | end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; |
| 458 | 458 | ||
| 459 | while (last_offset < compressed_end) { | 459 | while (last_offset < compressed_end) { |
| 460 | page_index = last_offset >> PAGE_CACHE_SHIFT; | 460 | pg_index = last_offset >> PAGE_CACHE_SHIFT; |
| 461 | 461 | ||
| 462 | if (page_index > end_index) | 462 | if (pg_index > end_index) |
| 463 | break; | 463 | break; |
| 464 | 464 | ||
| 465 | rcu_read_lock(); | 465 | rcu_read_lock(); |
| 466 | page = radix_tree_lookup(&mapping->page_tree, page_index); | 466 | page = radix_tree_lookup(&mapping->page_tree, pg_index); |
| 467 | rcu_read_unlock(); | 467 | rcu_read_unlock(); |
| 468 | if (page) { | 468 | if (page) { |
| 469 | misses++; | 469 | misses++; |
| @@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, | |||
| 477 | if (!page) | 477 | if (!page) |
| 478 | break; | 478 | break; |
| 479 | 479 | ||
| 480 | if (add_to_page_cache_lru(page, mapping, page_index, | 480 | if (add_to_page_cache_lru(page, mapping, pg_index, |
| 481 | GFP_NOFS)) { | 481 | GFP_NOFS)) { |
| 482 | page_cache_release(page); | 482 | page_cache_release(page); |
| 483 | goto next; | 483 | goto next; |
| @@ -561,7 +561,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
| 561 | unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; | 561 | unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE; |
| 562 | unsigned long compressed_len; | 562 | unsigned long compressed_len; |
| 563 | unsigned long nr_pages; | 563 | unsigned long nr_pages; |
| 564 | unsigned long page_index; | 564 | unsigned long pg_index; |
| 565 | struct page *page; | 565 | struct page *page; |
| 566 | struct block_device *bdev; | 566 | struct block_device *bdev; |
| 567 | struct bio *comp_bio; | 567 | struct bio *comp_bio; |
| @@ -614,10 +614,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
| 614 | 614 | ||
| 615 | bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; | 615 | bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; |
| 616 | 616 | ||
| 617 | for (page_index = 0; page_index < nr_pages; page_index++) { | 617 | for (pg_index = 0; pg_index < nr_pages; pg_index++) { |
| 618 | cb->compressed_pages[page_index] = alloc_page(GFP_NOFS | | 618 | cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS | |
| 619 | __GFP_HIGHMEM); | 619 | __GFP_HIGHMEM); |
| 620 | if (!cb->compressed_pages[page_index]) | 620 | if (!cb->compressed_pages[pg_index]) |
| 621 | goto fail2; | 621 | goto fail2; |
| 622 | } | 622 | } |
| 623 | cb->nr_pages = nr_pages; | 623 | cb->nr_pages = nr_pages; |
| @@ -635,8 +635,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
| 635 | comp_bio->bi_end_io = end_compressed_bio_read; | 635 | comp_bio->bi_end_io = end_compressed_bio_read; |
| 636 | atomic_inc(&cb->pending_bios); | 636 | atomic_inc(&cb->pending_bios); |
| 637 | 637 | ||
| 638 | for (page_index = 0; page_index < nr_pages; page_index++) { | 638 | for (pg_index = 0; pg_index < nr_pages; pg_index++) { |
| 639 | page = cb->compressed_pages[page_index]; | 639 | page = cb->compressed_pages[pg_index]; |
| 640 | page->mapping = inode->i_mapping; | 640 | page->mapping = inode->i_mapping; |
| 641 | page->index = em_start >> PAGE_CACHE_SHIFT; | 641 | page->index = em_start >> PAGE_CACHE_SHIFT; |
| 642 | 642 | ||
| @@ -703,8 +703,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
| 703 | return 0; | 703 | return 0; |
| 704 | 704 | ||
| 705 | fail2: | 705 | fail2: |
| 706 | for (page_index = 0; page_index < nr_pages; page_index++) | 706 | for (pg_index = 0; pg_index < nr_pages; pg_index++) |
| 707 | free_page((unsigned long)cb->compressed_pages[page_index]); | 707 | free_page((unsigned long)cb->compressed_pages[pg_index]); |
| 708 | 708 | ||
| 709 | kfree(cb->compressed_pages); | 709 | kfree(cb->compressed_pages); |
| 710 | fail1: | 710 | fail1: |
| @@ -946,7 +946,7 @@ void btrfs_exit_compress(void) | |||
| 946 | int btrfs_decompress_buf2page(c | ||
