aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2011-04-20 19:20:15 -0400
committerDavid Sterba <dsterba@suse.cz>2011-05-02 07:57:22 -0400
commitb3b4aa74b58bded927f579fff787fb6fa1c0393c (patch)
tree30dab4ab26558992dd8b6b212bef805de11c4c29 /fs/btrfs/tree-log.c
parentba14419264684b290f0d0b7f48d26eafb11fc0c6 (diff)
btrfs: drop unused parameter from btrfs_release_path
parameter tree root it's not used since commit 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee ("Btrfs: Create extent_buffer interface for large blocksizes") Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index d5313d63f967..c599e8c2a53c 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -333,13 +333,13 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,
333 goto insert; 333 goto insert;
334 334
335 if (item_size == 0) { 335 if (item_size == 0) {
336 btrfs_release_path(root, path); 336 btrfs_release_path(path);
337 return 0; 337 return 0;
338 } 338 }
339 dst_copy = kmalloc(item_size, GFP_NOFS); 339 dst_copy = kmalloc(item_size, GFP_NOFS);
340 src_copy = kmalloc(item_size, GFP_NOFS); 340 src_copy = kmalloc(item_size, GFP_NOFS);
341 if (!dst_copy || !src_copy) { 341 if (!dst_copy || !src_copy) {
342 btrfs_release_path(root, path); 342 btrfs_release_path(path);
343 kfree(dst_copy); 343 kfree(dst_copy);
344 kfree(src_copy); 344 kfree(src_copy);
345 return -ENOMEM; 345 return -ENOMEM;
@@ -361,13 +361,13 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,
361 * sync 361 * sync
362 */ 362 */
363 if (ret == 0) { 363 if (ret == 0) {
364 btrfs_release_path(root, path); 364 btrfs_release_path(path);
365 return 0; 365 return 0;
366 } 366 }
367 367
368 } 368 }
369insert: 369insert:
370 btrfs_release_path(root, path); 370 btrfs_release_path(path);
371 /* try to insert the key into the destination tree */ 371 /* try to insert the key into the destination tree */
372 ret = btrfs_insert_empty_item(trans, root, path, 372 ret = btrfs_insert_empty_item(trans, root, path,
373 key, item_size); 373 key, item_size);
@@ -438,7 +438,7 @@ insert:
438 } 438 }
439no_copy: 439no_copy:
440 btrfs_mark_buffer_dirty(path->nodes[0]); 440 btrfs_mark_buffer_dirty(path->nodes[0]);
441 btrfs_release_path(root, path); 441 btrfs_release_path(path);
442 return 0; 442 return 0;
443} 443}
444 444
@@ -544,11 +544,11 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
544 * we don't have to do anything 544 * we don't have to do anything
545 */ 545 */
546 if (memcmp(&cmp1, &cmp2, sizeof(cmp1)) == 0) { 546 if (memcmp(&cmp1, &cmp2, sizeof(cmp1)) == 0) {
547 btrfs_release_path(root, path); 547 btrfs_release_path(path);
548 goto out; 548 goto out;
549 } 549 }
550 } 550 }
551 btrfs_release_path(root, path); 551 btrfs_release_path(path);
552 552
553 saved_nbytes = inode_get_bytes(inode); 553 saved_nbytes = inode_get_bytes(inode);
554 /* drop any overlapping extents */ 554 /* drop any overlapping extents */
@@ -600,7 +600,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
600 key->objectid, offset, &ins); 600 key->objectid, offset, &ins);
601 BUG_ON(ret); 601 BUG_ON(ret);
602 } 602 }
603 btrfs_release_path(root, path); 603 btrfs_release_path(path);
604 604
605 if (btrfs_file_extent_compression(eb, item)) { 605 if (btrfs_file_extent_compression(eb, item)) {
606 csum_start = ins.objectid; 606 csum_start = ins.objectid;
@@ -629,7 +629,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
629 kfree(sums); 629 kfree(sums);
630 } 630 }
631 } else { 631 } else {
632 btrfs_release_path(root, path); 632 btrfs_release_path(path);
633 } 633 }
634 } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { 634 } else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
635 /* inline extents are easy, we just overwrite them */ 635 /* inline extents are easy, we just overwrite them */
@@ -675,7 +675,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
675 return -ENOMEM; 675 return -ENOMEM;
676 676
677 read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len); 677 read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len);
678 btrfs_release_path(root, path); 678 btrfs_release_path(path);
679 679
680 inode = read_one_inode(root, location.objectid); 680 inode = read_one_inode(root, location.objectid);
681 BUG_ON(!inode); 681 BUG_ON(!inode);
@@ -713,7 +713,7 @@ static noinline int inode_in_dir(struct btrfs_root *root,
713 goto out; 713 goto out;
714 } else 714 } else
715 goto out; 715 goto out;
716 btrfs_release_path(root, path); 716 btrfs_release_path(path);
717 717
718 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); 718 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0);
719 if (di && !IS_ERR(di)) { 719 if (di && !IS_ERR(di)) {
@@ -724,7 +724,7 @@ static noinline int inode_in_dir(struct btrfs_root *root,
724 goto out; 724 goto out;
725 match = 1; 725 match = 1;
726out: 726out:
727 btrfs_release_path(root, path); 727 btrfs_release_path(path);
728 return match; 728 return match;
729} 729}
730 730
@@ -884,7 +884,7 @@ again:
884 if (!backref_in_log(log, key, victim_name, 884 if (!backref_in_log(log, key, victim_name,
885 victim_name_len)) { 885 victim_name_len)) {
886 btrfs_inc_nlink(inode); 886 btrfs_inc_nlink(inode);
887 btrfs_release_path(root, path); 887 btrfs_release_path(path);
888 888
889 ret = btrfs_unlink_inode(trans, root, dir, 889 ret = btrfs_unlink_inode(trans, root, dir,
890 inode, victim_name, 890 inode, victim_name,
@@ -901,7 +901,7 @@ again:
901 */ 901 */
902 search_done = 1; 902 search_done = 1;
903 } 903 }
904 btrfs_release_path(root, path); 904 btrfs_release_path(path);
905 905
906insert: 906insert:
907 /* insert our name */ 907 /* insert our name */
@@ -922,7 +922,7 @@ out:
922 BUG_ON(ret); 922 BUG_ON(ret);
923 923
924out_nowrite: 924out_nowrite:
925 btrfs_release_path(root, path); 925 btrfs_release_path(path);
926 iput(dir); 926 iput(dir);
927 iput(inode); 927 iput(inode);
928 return 0; 928 return 0;
@@ -999,9 +999,9 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans,
999 if (key.offset == 0) 999 if (key.offset == 0)
1000 break; 1000 break;
1001 key.offset--; 1001 key.offset--;
1002 btrfs_release_path(root, path); 1002 btrfs_release_path(path);
1003 } 1003 }
1004 btrfs_release_path(root, path); 1004 btrfs_release_path(path);
1005 if (nlink != inode->i_nlink) { 1005 if (nlink != inode->i_nlink) {
1006 inode->i_nlink = nlink; 1006 inode->i_nlink = nlink;
1007 btrfs_update_inode(trans, root, inode); 1007 btrfs_update_inode(trans, root, inode);
@@ -1052,7 +1052,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
1052 ret = btrfs_del_item(trans, root, path); 1052 ret = btrfs_del_item(trans, root, path);
1053 BUG_ON(ret); 1053 BUG_ON(ret);
1054 1054
1055 btrfs_release_path(root, path); 1055 btrfs_release_path(path);
1056 inode = read_one_inode(root, key.offset); 1056 inode = read_one_inode(root, key.offset);
1057 BUG_ON(!inode); 1057 BUG_ON(!inode);
1058 1058
@@ -1068,7 +1068,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
1068 */ 1068 */
1069 key.offset = (u64)-1; 1069 key.offset = (u64)-1;
1070 } 1070 }
1071 btrfs_release_path(root, path); 1071 btrfs_release_path(path);
1072 return 0; 1072 return 0;
1073} 1073}
1074 1074
@@ -1096,7 +1096,7 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
1096 1096
1097 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); 1097 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
1098 1098
1099 btrfs_release_path(root, path); 1099 btrfs_release_path(path);
1100 if (ret == 0) { 1100 if (ret == 0) {
1101 btrfs_inc_nlink(inode); 1101 btrfs_inc_nlink(inode);
1102 btrfs_update_inode(trans, root, inode); 1102 btrfs_update_inode(trans, root, inode);
@@ -1192,7 +1192,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1192 exists = 1; 1192 exists = 1;
1193 else 1193 else
1194 exists = 0; 1194 exists = 0;
1195 btrfs_release_path(root, path); 1195 btrfs_release_path(path);
1196 1196
1197 if (key->type == BTRFS_DIR_ITEM_KEY) { 1197 if (key->type == BTRFS_DIR_ITEM_KEY) {
1198 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, 1198 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid,
@@ -1236,13 +1236,13 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
1236 if (key->type == BTRFS_DIR_INDEX_KEY) 1236 if (key->type == BTRFS_DIR_INDEX_KEY)
1237 goto insert; 1237 goto insert;
1238out: 1238out:
1239 btrfs_release_path(root, path); 1239 btrfs_release_path(path);
1240 kfree(name); 1240 kfree(name);
1241 iput(dir); 1241 iput(dir);
1242 return 0; 1242 return 0;
1243 1243
1244insert: 1244insert:
1245 btrfs_release_path(root, path); 1245 btrfs_release_path(path);
1246 ret = insert_one_name(trans, root, path, key->objectid, key->offset, 1246 ret = insert_one_name(trans, root, path, key->objectid, key->offset,
1247 name, name_len, log_type, &log_key); 1247 name, name_len, log_type, &log_key);
1248 1248
@@ -1363,7 +1363,7 @@ next:
1363 *end_ret = found_end; 1363 *end_ret = found_end;
1364 ret = 0; 1364 ret = 0;
1365out: 1365out:
1366 btrfs_release_path(root, path); 1366 btrfs_release_path(path);
1367 return ret; 1367 return ret;
1368} 1368}
1369 1369
@@ -1428,8 +1428,8 @@ again:
1428 } 1428 }
1429 if (IS_ERR_OR_NULL(log_di)) { 1429 if (IS_ERR_OR_NULL(log_di)) {
1430 btrfs_dir_item_key_to_cpu(eb, di, &location); 1430 btrfs_dir_item_key_to_cpu(eb, di, &location);
1431 btrfs_release_path(root, path); 1431 btrfs_release_path(path);
1432 btrfs_release_path(log, log_path); 1432 btrfs_release_path(log_path);
1433 inode = read_one_inode(root, location.objectid); 1433 inode = read_one_inode(root, location.objectid);
1434 BUG_ON(!inode); 1434 BUG_ON(!inode);
1435 1435
@@ -1453,7 +1453,7 @@ again:
1453 ret = 0; 1453 ret = 0;
1454 goto out; 1454 goto out;
1455 } 1455 }
1456 btrfs_release_path(log, log_path); 1456 btrfs_release_path(log_path);
1457 kfree(name); 1457 kfree(name);
1458 1458
1459 ptr = (unsigned long)(di + 1); 1459 ptr = (unsigned long)(di + 1);
@@ -1461,8 +1461,8 @@ again:
1461 } 1461 }
1462 ret = 0; 1462 ret = 0;
1463out: 1463out:
1464 btrfs_release_path(root, path); 1464 btrfs_release_path(path);
1465 btrfs_release_path(log, log_path); 1465 btrfs_release_path(log_path);
1466 return ret; 1466 return ret;
1467} 1467}
1468 1468
@@ -1550,7 +1550,7 @@ again:
1550 break; 1550 break;
1551 dir_key.offset = found_key.offset + 1; 1551 dir_key.offset = found_key.offset + 1;
1552 } 1552 }
1553 btrfs_release_path(root, path); 1553 btrfs_release_path(path);
1554 if (range_end == (u64)-1) 1554 if (range_end == (u64)-1)
1555 break; 1555 break;
1556 range_start = range_end + 1; 1556 range_start = range_end + 1;
@@ -1561,11 +1561,11 @@ next_type:
1561 if (key_type == BTRFS_DIR_LOG_ITEM_KEY) { 1561 if (key_type == BTRFS_DIR_LOG_ITEM_KEY) {
1562 key_type = BTRFS_DIR_LOG_INDEX_KEY; 1562 key_type = BTRFS_DIR_LOG_INDEX_KEY;
1563 dir_key.type = BTRFS_DIR_INDEX_KEY; 1563 dir_key.type = BTRFS_DIR_INDEX_KEY;
1564 btrfs_release_path(root, path); 1564 btrfs_release_path(path);
1565 goto again; 1565 goto again;
1566 } 1566 }
1567out: 1567out:
1568 btrfs_release_path(root, path); 1568 btrfs_release_path(path);
1569 btrfs_free_path(log_path); 1569 btrfs_free_path(log_path);
1570 iput(dir); 1570 iput(dir);
1571 return ret; 1571 return ret;
@@ -2225,7 +2225,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2225 bytes_del += name_len; 2225 bytes_del += name_len;
2226 BUG_ON(ret); 2226 BUG_ON(ret);
2227 } 2227 }
2228 btrfs_release_path(log, path); 2228 btrfs_release_path(path);
2229 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino, 2229 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino,
2230 index, name, name_len, -1); 2230 index, name, name_len, -1);
2231 if (IS_ERR(di)) { 2231 if (IS_ERR(di)) {
@@ -2247,7 +2247,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2247 key.objectid = dir->i_ino; 2247 key.objectid = dir->i_ino;
2248 key.offset = 0; 2248 key.offset = 0;
2249 key.type = BTRFS_INODE_ITEM_KEY; 2249 key.type = BTRFS_INODE_ITEM_KEY;
2250 btrfs_release_path(log, path); 2250 btrfs_release_path(path);
2251 2251
2252 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); 2252 ret = btrfs_search_slot(trans, log, &key, path, 0, 1);
2253 if (ret < 0) { 2253 if (ret < 0) {
@@ -2269,7 +2269,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
2269 btrfs_mark_buffer_dirty(path->nodes[0]); 2269 btrfs_mark_buffer_dirty(path->nodes[0]);
2270 } else 2270 } else
2271 ret = 0; 2271 ret = 0;
2272 btrfs_release_path(log, path); 2272 btrfs_release_path(path);
2273 } 2273 }
2274fail: 2274fail:
2275 btrfs_free_path(path); 2275 btrfs_free_path(path);
@@ -2344,7 +2344,7 @@ static noinline int insert_dir_log_key(struct btrfs_trans_handle *trans,
2344 struct btrfs_dir_log_item); 2344 struct btrfs_dir_log_item);
2345 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); 2345 btrfs_set_dir_log_end(path->nodes[0], item, last_offset);
2346 btrfs_mark_buffer_dirty(path->nodes[0]); 2346 btrfs_mark_buffer_dirty(path->nodes[0]);
2347 btrfs_release_path(log, path); 2347 btrfs_release_path(path);
2348 return 0; 2348 return 0;
2349} 2349}
2350 2350
@@ -2393,10 +2393,10 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2393 min_key.objectid = inode->i_ino; 2393 min_key.objectid = inode->i_ino;
2394 min_key.type = key_type; 2394 min_key.type = key_type;
2395 min_key.offset = (u64)-1; 2395 min_key.offset = (u64)-1;
2396 btrfs_release_path(root, path); 2396 btrfs_release_path(path);
2397 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 2397 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
2398 if (ret < 0) { 2398 if (ret < 0) {
2399 btrfs_release_path(root, path); 2399 btrfs_release_path(path);
2400 return ret; 2400 return ret;
2401 } 2401 }
2402 ret = btrfs_previous_item(root, path, inode->i_ino, key_type); 2402 ret = btrfs_previous_item(root, path, inode->i_ino, key_type);
@@ -2432,7 +2432,7 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2432 } 2432 }
2433 } 2433 }
2434 } 2434 }
2435 btrfs_release_path(root, path); 2435 btrfs_release_path(path);
2436 2436
2437 /* find the first key from this transaction again */ 2437 /* find the first key from this transaction again */
2438 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); 2438 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
@@ -2490,8 +2490,8 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2490 } 2490 }
2491 } 2491 }
2492done: 2492done:
2493 btrfs_release_path(root, path); 2493 btrfs_release_path(path);
2494 btrfs_release_path(log, dst_path); 2494 btrfs_release_path(dst_path);
2495 2495
2496 if (err == 0) { 2496 if (err == 0) {
2497 *last_offset_ret = last_offset; 2497 *last_offset_ret = last_offset;
@@ -2588,9 +2588,9 @@ static int drop_objectid_items(struct btrfs_trans_handle *trans,
2588 2588
2589 ret = btrfs_del_item(trans, log, path); 2589 ret = btrfs_del_item(trans, log, path);
2590 BUG_ON(ret); 2590 BUG_ON(ret);
2591 btrfs_release_path(log, path); 2591 btrfs_release_path(path);
2592 } 2592 }
2593 btrfs_release_path(log, path); 2593 btrfs_release_path(path);
2594 return ret; 2594 return ret;
2595} 2595}
2596 2596
@@ -2696,7 +2696,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
2696 } 2696 }
2697 2697
2698 btrfs_mark_buffer_dirty(dst_path->nodes[0]); 2698 btrfs_mark_buffer_dirty(dst_path->nodes[0]);
2699 btrfs_release_path(log, dst_path); 2699 btrfs_release_path(dst_path);
2700 kfree(ins_data); 2700 kfree(ins_data);
2701 2701
2702 /* 2702 /*
@@ -2845,7 +2845,7 @@ next_slot:
2845 } 2845 }
2846 ins_nr = 0; 2846 ins_nr = 0;
2847 } 2847 }
2848 btrfs_release_path(root, path); 2848 btrfs_release_path(path);
2849 2849
2850 if (min_key.offset < (u64)-1) 2850 if (min_key.offset < (u64)-1)
2851 min_key.offset++; 2851 min_key.offset++;
@@ -2868,8 +2868,8 @@ next_slot:
2868 } 2868 }
2869 WARN_ON(ins_nr); 2869 WARN_ON(ins_nr);
2870 if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) { 2870 if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
2871 btrfs_release_path(root, path); 2871 btrfs_release_path(path);
2872 btrfs_release_path(log, dst_path); 2872 btrfs_release_path(dst_path);
2873 ret = log_directory_changes(trans, root, inode, path, dst_path); 2873 ret = log_directory_changes(trans, root, inode, path, dst_path);
2874 if (ret) { 2874 if (ret) {
2875 err = ret; 2875 err = ret;
@@ -3136,7 +3136,7 @@ again:
3136 } 3136 }
3137 btrfs_item_key_to_cpu(path->nodes[0], &found_key, 3137 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
3138 path->slots[0]); 3138 path->slots[0]);
3139 btrfs_release_path(log_root_tree, path); 3139 btrfs_release_path(path);
3140 if (found_key.objectid != BTRFS_TREE_LOG_OBJECTID) 3140 if (found_key.objectid != BTRFS_TREE_LOG_OBJECTID)
3141 break; 3141 break;
3142 3142
@@ -3171,7 +3171,7 @@ again:
3171 if (found_key.offset == 0) 3171 if (found_key.offset == 0)
3172 break; 3172 break;
3173 } 3173 }
3174 btrfs_release_path(log_root_tree, path); 3174 btrfs_release_path(path);
3175 3175
3176 /* step one is to pin it all, step two is to replay just inodes */ 3176 /* step one is to pin it all, step two is to replay just inodes */
3177 if (wc.pin) { 3177 if (wc.pin) {