Skip to content

Commit b3b4aa7

Browse files
committed
btrfs: drop unused parameter from btrfs_release_path
parameter tree root it's not used since commit 5f39d39 ("Btrfs: Create extent_buffer interface for large blocksizes") Signed-off-by: David Sterba <dsterba@suse.cz>
1 parent ba14419 commit b3b4aa7

15 files changed

Lines changed: 160 additions & 160 deletions

‎fs/btrfs/ctree.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void btrfs_free_path(struct btrfs_path *p)
107107
{
108108
if (!p)
109109
return;
110-
btrfs_release_path(NULL, p);
110+
btrfs_release_path(p);
111111
kmem_cache_free(btrfs_path_cachep, p);
112112
}
113113

@@ -117,7 +117,7 @@ void btrfs_free_path(struct btrfs_path *p)
117117
*
118118
* It is safe to call this on paths that no locks or extent buffers held.
119119
*/
120-
noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
120+
noinline void btrfs_release_path(struct btrfs_path *p)
121121
{
122122
int i;
123123

@@ -1328,7 +1328,7 @@ static noinline int reada_for_balance(struct btrfs_root *root,
13281328
ret = -EAGAIN;
13291329

13301330
/* release the whole path */
1331-
btrfs_release_path(root, path);
1331+
btrfs_release_path(path);
13321332

13331333
/* read the blocks */
13341334
if (block1)
@@ -1475,7 +1475,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
14751475
return 0;
14761476
}
14771477
free_extent_buffer(tmp);
1478-
btrfs_release_path(NULL, p);
1478+
btrfs_release_path(p);
14791479
return -EIO;
14801480
}
14811481
}
@@ -1494,7 +1494,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
14941494
if (p->reada)
14951495
reada_for_search(root, p, level, slot, key->objectid);
14961496

1497-
btrfs_release_path(NULL, p);
1497+
btrfs_release_path(p);
14981498

14991499
ret = -EAGAIN;
15001500
tmp = read_tree_block(root, blocknr, blocksize, 0);
@@ -1563,7 +1563,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans,
15631563
}
15641564
b = p->nodes[level];
15651565
if (!b) {
1566-
btrfs_release_path(NULL, p);
1566+
btrfs_release_path(p);
15671567
goto again;
15681568
}
15691569
BUG_ON(btrfs_header_nritems(b) == 1);
@@ -1753,7 +1753,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
17531753
if (!p->leave_spinning)
17541754
btrfs_set_path_blocking(p);
17551755
if (ret < 0)
1756-
btrfs_release_path(root, p);
1756+
btrfs_release_path(p);
17571757
return ret;
17581758
}
17591759

@@ -3026,7 +3026,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
30263026
struct btrfs_file_extent_item);
30273027
extent_len = btrfs_file_extent_num_bytes(leaf, fi);
30283028
}
3029-
btrfs_release_path(root, path);
3029+
btrfs_release_path(path);
30303030

30313031
path->keep_locks = 1;
30323032
path->search_for_split = 1;
@@ -3948,7 +3948,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
39483948
else
39493949
return 1;
39503950

3951-
btrfs_release_path(root, path);
3951+
btrfs_release_path(path);
39523952
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
39533953
if (ret < 0)
39543954
return ret;
@@ -4072,7 +4072,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
40724072
sret = btrfs_find_next_key(root, path, min_key, level,
40734073
cache_only, min_trans);
40744074
if (sret == 0) {
4075-
btrfs_release_path(root, path);
4075+
btrfs_release_path(path);
40764076
goto again;
40774077
} else {
40784078
goto out;
@@ -4151,7 +4151,7 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
41514151
btrfs_node_key_to_cpu(c, &cur_key, slot);
41524152

41534153
orig_lowest = path->lowest_level;
4154-
btrfs_release_path(root, path);
4154+
btrfs_release_path(path);
41554155
path->lowest_level = level;
41564156
ret = btrfs_search_slot(NULL, root, &cur_key, path,
41574157
0, 0);
@@ -4228,7 +4228,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
42284228
again:
42294229
level = 1;
42304230
next = NULL;
4231-
btrfs_release_path(root, path);
4231+
btrfs_release_path(path);
42324232

42334233
path->keep_locks = 1;
42344234

@@ -4284,7 +4284,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
42844284
goto again;
42854285

42864286
if (ret < 0) {
4287-
btrfs_release_path(root, path);
4287+
btrfs_release_path(path);
42884288
goto done;
42894289
}
42904290

@@ -4323,7 +4323,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
43234323
goto again;
43244324

43254325
if (ret < 0) {
4326-
btrfs_release_path(root, path);
4326+
btrfs_release_path(path);
43274327
goto done;
43284328
}
43294329

‎fs/btrfs/ctree.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
22902290
struct btrfs_root *root, struct extent_buffer *parent,
22912291
int start_slot, int cache_only, u64 *last_ret,
22922292
struct btrfs_key *progress);
2293-
void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
2293+
void btrfs_release_path(struct btrfs_path *p);
22942294
struct btrfs_path *btrfs_alloc_path(void);
22952295
void btrfs_free_path(struct btrfs_path *p);
22962296
void btrfs_set_path_blocking(struct btrfs_path *p);

‎fs/btrfs/dir-item.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
172172
ret = 0;
173173
goto out_free;
174174
}
175-
btrfs_release_path(root, path);
175+
btrfs_release_path(path);
176176

177177
btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
178178
key.offset = index;

‎fs/btrfs/extent-tree.c‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int caching_kthread(void *data)
379379
break;
380380

381381
caching_ctl->progress = last;
382-
btrfs_release_path(extent_root, path);
382+
btrfs_release_path(path);
383383
up_read(&fs_info->extent_commit_sem);
384384
mutex_unlock(&caching_ctl->mutex);
385385
if (btrfs_transaction_in_commit(fs_info))
@@ -754,7 +754,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
754754
atomic_inc(&head->node.refs);
755755
spin_unlock(&delayed_refs->lock);
756756

757-
btrfs_release_path(root->fs_info->extent_root, path);
757+
btrfs_release_path(path);
758758

759759
mutex_lock(&head->mutex);
760760
mutex_unlock(&head->mutex);
@@ -934,7 +934,7 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
934934
break;
935935
}
936936
}
937-
btrfs_release_path(root, path);
937+
btrfs_release_path(path);
938938

939939
if (owner < BTRFS_FIRST_FREE_OBJECTID)
940940
new_size += sizeof(*bi);
@@ -1042,7 +1042,7 @@ static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
10421042
return 0;
10431043
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
10441044
key.type = BTRFS_EXTENT_REF_V0_KEY;
1045-
btrfs_release_path(root, path);
1045+
btrfs_release_path(path);
10461046
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
10471047
if (ret < 0) {
10481048
err = ret;
@@ -1080,7 +1080,7 @@ static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
10801080
if (match_extent_data_ref(leaf, ref, root_objectid,
10811081
owner, offset)) {
10821082
if (recow) {
1083-
btrfs_release_path(root, path);
1083+
btrfs_release_path(path);
10841084
goto again;
10851085
}
10861086
err = 0;
@@ -1141,7 +1141,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
11411141
if (match_extent_data_ref(leaf, ref, root_objectid,
11421142
owner, offset))
11431143
break;
1144-
btrfs_release_path(root, path);
1144+
btrfs_release_path(path);
11451145
key.offset++;
11461146
ret = btrfs_insert_empty_item(trans, root, path, &key,
11471147
size);
@@ -1167,7 +1167,7 @@ static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
11671167
btrfs_mark_buffer_dirty(leaf);
11681168
ret = 0;
11691169
fail:
1170-
btrfs_release_path(root, path);
1170+
btrfs_release_path(path);
11711171
return ret;
11721172
}
11731173

@@ -1293,7 +1293,7 @@ static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
12931293
ret = -ENOENT;
12941294
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
12951295
if (ret == -ENOENT && parent) {
1296-
btrfs_release_path(root, path);
1296+
btrfs_release_path(path);
12971297
key.type = BTRFS_EXTENT_REF_V0_KEY;
12981298
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
12991299
if (ret > 0)
@@ -1322,7 +1322,7 @@ static noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
13221322
}
13231323

13241324
ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
1325-
btrfs_release_path(root, path);
1325+
btrfs_release_path(path);
13261326
return ret;
13271327
}
13281328

@@ -1608,7 +1608,7 @@ static int lookup_extent_backref(struct btrfs_trans_handle *trans,
16081608
if (ret != -ENOENT)
16091609
return ret;
16101610

1611-
btrfs_release_path(root, path);
1611+
btrfs_release_path(path);
16121612
*ref_ret = NULL;
16131613

16141614
if (owner < BTRFS_FIRST_FREE_OBJECTID) {
@@ -1862,7 +1862,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
18621862
__run_delayed_extent_op(extent_op, leaf, item);
18631863

18641864
btrfs_mark_buffer_dirty(leaf);
1865-
btrfs_release_path(root->fs_info->extent_root, path);
1865+
btrfs_release_path(path);
18661866

18671867
path->reada = 1;
18681868
path->leave_spinning = 1;
@@ -2361,7 +2361,7 @@ static noinline int check_delayed_ref(struct btrfs_trans_handle *trans,
23612361
atomic_inc(&head->node.refs);
23622362
spin_unlock(&delayed_refs->lock);
23632363

2364-
btrfs_release_path(root->fs_info->extent_root, path);
2364+
btrfs_release_path(path);
23652365

23662366
mutex_lock(&head->mutex);
23672367
mutex_unlock(&head->mutex);
@@ -2732,7 +2732,7 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
27322732
bi = btrfs_item_ptr_offset(leaf, path->slots[0]);
27332733
write_extent_buffer(leaf, &cache->item, bi, sizeof(cache->item));
27342734
btrfs_mark_buffer_dirty(leaf);
2735-
btrfs_release_path(extent_root, path);
2735+
btrfs_release_path(path);
27362736
fail:
27372737
if (ret)
27382738
return ret;
@@ -2785,7 +2785,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
27852785
inode = lookup_free_space_inode(root, block_group, path);
27862786
if (IS_ERR(inode) && PTR_ERR(inode) != -ENOENT) {
27872787
ret = PTR_ERR(inode);
2788-
btrfs_release_path(root, path);
2788+
btrfs_release_path(path);
27892789
goto out;
27902790
}
27912791

@@ -2854,7 +2854,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
28542854
out_put:
28552855
iput(inode);
28562856
out_free:
2857-
btrfs_release_path(root, path);
2857+
btrfs_release_path(path);
28582858
out:
28592859
spin_lock(&block_group->lock);
28602860
block_group->disk_cache_state = dcs;
@@ -4541,7 +4541,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
45414541
NULL, refs_to_drop,
45424542
is_data);
45434543
BUG_ON(ret);
4544-
btrfs_release_path(extent_root, path);
4544+
btrfs_release_path(path);
45454545
path->leave_spinning = 1;
45464546

45474547
key.objectid = bytenr;
@@ -4580,7 +4580,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
45804580
owner_objectid, 0);
45814581
BUG_ON(ret < 0);
45824582

4583-
btrfs_release_path(extent_root, path);
4583+
btrfs_release_path(path);
45844584
path->leave_spinning = 1;
45854585

45864586
key.objectid = bytenr;
@@ -4650,7 +4650,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
46504650
ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
46514651
num_to_del);
46524652
BUG_ON(ret);
4653-
btrfs_release_path(extent_root, path);
4653+
btrfs_release_path(path);
46544654

46554655
if (is_data) {
46564656
ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
@@ -6480,7 +6480,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
64806480
trans->block_rsv = block_rsv;
64816481
}
64826482
}
6483-
btrfs_release_path(root, path);
6483+
btrfs_release_path(path);
64846484
BUG_ON(err);
64856485

64866486
ret = btrfs_del_root(trans, tree_root, &root->root_key);
@@ -8580,7 +8580,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
85808580
memcpy(&cache->key, &found_key, sizeof(found_key));
85818581

85828582
key.objectid = found_key.objectid + found_key.offset;
8583-
btrfs_release_path(root, path);
8583+
btrfs_release_path(path);
85848584
cache->flags = btrfs_block_group_flags(&cache->item);
85858585
cache->sectorsize = root->sectorsize;
85868586

@@ -8802,12 +8802,12 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
88028802
if (ret < 0)
88038803
goto out;
88048804
if (ret > 0)
8805-
btrfs_release_path(tree_root, path);
8805+
btrfs_release_path(path);
88068806
if (ret == 0) {
88078807
ret = btrfs_del_item(trans, tree_root, path);
88088808
if (ret)
88098809
goto out;
8810-
btrfs_release_path(tree_root, path);
8810+
btrfs_release_path(path);
88118811
}
88128812

88138813
spin_lock(&root->fs_info->block_group_cache_lock);

‎fs/btrfs/file-item.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
193193
u32 item_size;
194194

195195
if (item)
196-
btrfs_release_path(root, path);
196+
btrfs_release_path(path);
197197
item = btrfs_lookup_csum(NULL, root->fs_info->csum_root,
198198
path, disk_bytenr, 0);
199199
if (IS_ERR(item)) {
@@ -213,7 +213,7 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
213213
(unsigned long long)offset);
214214
}
215215
item = NULL;
216-
btrfs_release_path(root, path);
216+
btrfs_release_path(path);
217217
goto found;
218218
}
219219
btrfs_item_key_to_cpu(path->nodes[0], &found_key,
@@ -631,7 +631,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
631631
if (key.offset < bytenr)
632632
break;
633633
}
634-
btrfs_release_path(root, path);
634+
btrfs_release_path(path);
635635
}
636636
out:
637637
btrfs_free_path(path);
@@ -722,7 +722,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
722722
* at this point, we know the tree has an item, but it isn't big
723723
* enough yet to put our csum in. Grow it
724724
*/
725-
btrfs_release_path(root, path);
725+
btrfs_release_path(path);
726726
ret = btrfs_search_slot(trans, root, &file_key, path,
727727
csum_size, 1);
728728
if (ret < 0)
@@ -766,7 +766,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
766766
}
767767

768768
insert:
769-
btrfs_release_path(root, path);
769+
btrfs_release_path(path);
770770
csum_offset = 0;
771771
if (found_next) {
772772
u64 tmp = total_bytes + root->sectorsize;
@@ -850,7 +850,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
850850
}
851851
btrfs_mark_buffer_dirty(path->nodes[0]);
852852
if (total_bytes < sums->len) {
853-
btrfs_release_path(root, path);
853+
btrfs_release_path(path);
854854
cond_resched();
855855
goto again;
856856
}

0 commit comments

Comments
 (0)