Skip to content

Commit 945d896

Browse files
committed
Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable into inode_numbers
Conflicts: fs/btrfs/extent-tree.c fs/btrfs/free-space-cache.c fs/btrfs/inode.c fs/btrfs/tree-log.c Signed-off-by: Chris Mason <chris.mason@oracle.com>
2 parents 0d0ca30 + 4ea0288 commit 945d896

38 files changed

Lines changed: 295 additions & 3234 deletions

‎fs/btrfs/acl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int btrfs_acl_chmod(struct inode *inode)
288288
return 0;
289289

290290
acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS);
291-
if (IS_ERR(acl) || !acl)
291+
if (IS_ERR_OR_NULL(acl))
292292
return PTR_ERR(acl);
293293

294294
clone = posix_acl_clone(acl, GFP_KERNEL);

‎fs/btrfs/compression.c‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
333333
struct compressed_bio *cb;
334334
unsigned long bytes_left;
335335
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
336-
int page_index = 0;
336+
int pg_index = 0;
337337
struct page *page;
338338
u64 first_byte = disk_start;
339339
struct block_device *bdev;
@@ -367,8 +367,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
367367

368368
/* create and submit bios for the compressed pages */
369369
bytes_left = compressed_len;
370-
for (page_index = 0; page_index < cb->nr_pages; page_index++) {
371-
page = compressed_pages[page_index];
370+
for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) {
371+
page = compressed_pages[pg_index];
372372
page->mapping = inode->i_mapping;
373373
if (bio->bi_size)
374374
ret = io_tree->ops->merge_bio_hook(page, 0,
@@ -433,7 +433,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
433433
struct compressed_bio *cb)
434434
{
435435
unsigned long end_index;
436-
unsigned long page_index;
436+
unsigned long pg_index;
437437
u64 last_offset;
438438
u64 isize = i_size_read(inode);
439439
int ret;
@@ -457,13 +457,13 @@ static noinline int add_ra_bio_pages(struct inode *inode,
457457
end_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT;
458458

459459
while (last_offset < compressed_end) {
460-
page_index = last_offset >> PAGE_CACHE_SHIFT;
460+
pg_index = last_offset >> PAGE_CACHE_SHIFT;
461461

462-
if (page_index > end_index)
462+
if (pg_index > end_index)
463463
break;
464464

465465
rcu_read_lock();
466-
page = radix_tree_lookup(&mapping->page_tree, page_index);
466+
page = radix_tree_lookup(&mapping->page_tree, pg_index);
467467
rcu_read_unlock();
468468
if (page) {
469469
misses++;
@@ -477,7 +477,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
477477
if (!page)
478478
break;
479479

480-
if (add_to_page_cache_lru(page, mapping, page_index,
480+
if (add_to_page_cache_lru(page, mapping, pg_index,
481481
GFP_NOFS)) {
482482
page_cache_release(page);
483483
goto next;
@@ -561,7 +561,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
561561
unsigned long uncompressed_len = bio->bi_vcnt * PAGE_CACHE_SIZE;
562562
unsigned long compressed_len;
563563
unsigned long nr_pages;
564-
unsigned long page_index;
564+
unsigned long pg_index;
565565
struct page *page;
566566
struct block_device *bdev;
567567
struct bio *comp_bio;
@@ -614,10 +614,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
614614

615615
bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev;
616616

617-
for (page_index = 0; page_index < nr_pages; page_index++) {
618-
cb->compressed_pages[page_index] = alloc_page(GFP_NOFS |
617+
for (pg_index = 0; pg_index < nr_pages; pg_index++) {
618+
cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS |
619619
__GFP_HIGHMEM);
620-
if (!cb->compressed_pages[page_index])
620+
if (!cb->compressed_pages[pg_index])
621621
goto fail2;
622622
}
623623
cb->nr_pages = nr_pages;
@@ -635,8 +635,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
635635
comp_bio->bi_end_io = end_compressed_bio_read;
636636
atomic_inc(&cb->pending_bios);
637637

638-
for (page_index = 0; page_index < nr_pages; page_index++) {
639-
page = cb->compressed_pages[page_index];
638+
for (pg_index = 0; pg_index < nr_pages; pg_index++) {
639+
page = cb->compressed_pages[pg_index];
640640
page->mapping = inode->i_mapping;
641641
page->index = em_start >> PAGE_CACHE_SHIFT;
642642

@@ -703,8 +703,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
703703
return 0;
704704

705705
fail2:
706-
for (page_index = 0; page_index < nr_pages; page_index++)
707-
free_page((unsigned long)cb->compressed_pages[page_index]);
706+
for (pg_index = 0; pg_index < nr_pages; pg_index++)
707+
free_page((unsigned long)cb->compressed_pages[pg_index]);
708708

709709
kfree(cb->compressed_pages);
710710
fail1:
@@ -946,7 +946,7 @@ void btrfs_exit_compress(void)
946946
int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
947947
unsigned long total_out, u64 disk_start,
948948
struct bio_vec *bvec, int vcnt,
949-
unsigned long *page_index,
949+
unsigned long *pg_index,
950950
unsigned long *pg_offset)
951951
{
952952
unsigned long buf_offset;
@@ -955,7 +955,7 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
955955
unsigned long working_bytes = total_out - buf_start;
956956
unsigned long bytes;
957957
char *kaddr;
958-
struct page *page_out = bvec[*page_index].bv_page;
958+
struct page *page_out = bvec[*pg_index].bv_page;
959959

960960
/*
961961
* start byte is the first byte of the page we're currently
@@ -996,11 +996,11 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
996996

997997
/* check if we need to pick another page */
998998
if (*pg_offset == PAGE_CACHE_SIZE) {
999-
(*page_index)++;
1000-
if (*page_index >= vcnt)
999+
(*pg_index)++;
1000+
if (*pg_index >= vcnt)
10011001
return 0;
10021002

1003-
page_out = bvec[*page_index].bv_page;
1003+
page_out = bvec[*pg_index].bv_page;
10041004
*pg_offset = 0;
10051005
start_byte = page_offset(page_out) - disk_start;
10061006

‎fs/btrfs/compression.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,
3737
int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
3838
unsigned long total_out, u64 disk_start,
3939
struct bio_vec *bvec, int vcnt,
40-
unsigned long *page_index,
40+
unsigned long *pg_index,
4141
unsigned long *pg_offset);
4242

4343
int btrfs_submit_compressed_write(struct inode *inode, u64 start,

‎fs/btrfs/ctree.c‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void btrfs_free_path(struct btrfs_path *p)
102102
{
103103
if (!p)
104104
return;
105-
btrfs_release_path(NULL, p);
105+
btrfs_release_path(p);
106106
kmem_cache_free(btrfs_path_cachep, p);
107107
}
108108

@@ -112,7 +112,7 @@ void btrfs_free_path(struct btrfs_path *p)
112112
*
113113
* It is safe to call this on paths that no locks or extent buffers held.
114114
*/
115-
noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
115+
noinline void btrfs_release_path(struct btrfs_path *p)
116116
{
117117
int i;
118118

@@ -1323,7 +1323,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
13231323
ret = -EAGAIN;
13241324

13251325
/* release the whole path */
1326-
btrfs_release_path(root, path);
1326+
btrfs_release_path(path);
13271327

13281328
/* read the blocks */
13291329
if (block1)
@@ -1470,7 +1470,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
14701470
return 0;
14711471
}
14721472
free_extent_buffer(tmp);
1473-
btrfs_release_path(NULL, p);
1473+
btrfs_release_path(p);
14741474
return -EIO;
14751475
}
14761476
}
@@ -1489,7 +1489,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
14891489
if (p->reada)
14901490
reada_for_search(root, p, level, slot, key->objectid);
14911491

1492-
btrfs_release_path(NULL, p);
1492+
btrfs_release_path(p);
14931493

14941494
ret = -EAGAIN;
14951495
tmp = read_tree_block(root, blocknr, blocksize, 0);
@@ -1558,7 +1558,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans,
15581558
}
15591559
b = p->nodes[level];
15601560
if (!b) {
1561-
btrfs_release_path(NULL, p);
1561+
btrfs_release_path(p);
15621562
goto again;
15631563
}
15641564
BUG_ON(btrfs_header_nritems(b) == 1);
@@ -1748,7 +1748,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
17481748
if (!p->leave_spinning)
17491749
btrfs_set_path_blocking(p);
17501750
if (ret < 0)
1751-
btrfs_release_path(root, p);
1751+
btrfs_release_path(p);
17521752
return ret;
17531753
}
17541754

@@ -3021,7 +3021,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
30213021
struct btrfs_file_extent_item);
30223022
extent_len = btrfs_file_extent_num_bytes(leaf, fi);
30233023
}
3024-
btrfs_release_path(root, path);
3024+
btrfs_release_path(path);
30253025

30263026
path->keep_locks = 1;
30273027
path->search_for_split = 1;
@@ -3641,7 +3641,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans,
36413641

36423642
ret = 0;
36433643
if (slot == 0) {
3644-
struct btrfs_disk_key disk_key;
36453644
btrfs_cpu_key_to_disk(&disk_key, cpu_key);
36463645
ret = fixup_low_keys(trans, root, path, &disk_key, 1);
36473646
}
@@ -3943,7 +3942,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
39433942
else
39443943
return 1;
39453944

3946-
btrfs_release_path(root, path);
3945+
btrfs_release_path(path);
39473946
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
39483947
if (ret < 0)
39493948
return ret;
@@ -4067,7 +4066,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
40674066
sret = btrfs_find_next_key(root, path, min_key, level,
40684067
cache_only, min_trans);
40694068
if (sret == 0) {
4070-
btrfs_release_path(root, path);
4069+
btrfs_release_path(path);
40714070
goto again;
40724071
} else {
40734072
goto out;
@@ -4146,7 +4145,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
41464145
btrfs_node_key_to_cpu(c, &cur_key, slot);
41474146

41484147
orig_lowest = path->lowest_level;
4149-
btrfs_release_path(root, path);
4148+
btrfs_release_path(path);
41504149
path->lowest_level = level;
41514150
ret = btrfs_search_slot(NULL, root, &cur_key, path,
41524151
0, 0);
@@ -4223,7 +4222,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
42234222
again:
42244223
level = 1;
42254224
next = NULL;
4226-
btrfs_release_path(root, path);
4225+
btrfs_release_path(path);
42274226

42284227
path->keep_locks = 1;
42294228

@@ -4279,7 +4278,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
42794278
goto again;
42804279

42814280
if (ret < 0) {
4282-
btrfs_release_path(root, path);
4281+
btrfs_release_path(path);
42834282
goto done;
42844283
}
42854284

@@ -4318,7 +4317,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
43184317
goto again;
43194318

43204319
if (ret < 0) {
4321-
btrfs_release_path(root, path);
4320+
btrfs_release_path(path);
43224321
goto done;
43234322
}
43244323

0 commit comments

Comments
 (0)