Lines Matching refs:path
25 struct nilfs_btree_path *path; in nilfs_btree_alloc_path() local
28 path = kmem_cache_alloc(nilfs_btree_path_cache, GFP_NOFS); in nilfs_btree_alloc_path()
29 if (path == NULL) in nilfs_btree_alloc_path()
33 path[level].bp_bh = NULL; in nilfs_btree_alloc_path()
34 path[level].bp_sib_bh = NULL; in nilfs_btree_alloc_path()
35 path[level].bp_index = 0; in nilfs_btree_alloc_path()
36 path[level].bp_oldreq.bpr_ptr = NILFS_BMAP_INVALID_PTR; in nilfs_btree_alloc_path()
37 path[level].bp_newreq.bpr_ptr = NILFS_BMAP_INVALID_PTR; in nilfs_btree_alloc_path()
38 path[level].bp_op = NULL; in nilfs_btree_alloc_path()
42 return path; in nilfs_btree_alloc_path()
45 static void nilfs_btree_free_path(struct nilfs_btree_path *path) in nilfs_btree_free_path() argument
50 brelse(path[level].bp_bh); in nilfs_btree_free_path()
52 kmem_cache_free(nilfs_btree_path_cache, path); in nilfs_btree_free_path()
417 nilfs_btree_get_nonroot_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_nonroot_node() argument
419 return (struct nilfs_btree_node *)path[level].bp_bh->b_data; in nilfs_btree_get_nonroot_node()
423 nilfs_btree_get_sib_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_sib_node() argument
425 return (struct nilfs_btree_node *)path[level].bp_sib_bh->b_data; in nilfs_btree_get_sib_node()
435 const struct nilfs_btree_path *path, in nilfs_btree_get_node() argument
444 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_node()
548 struct nilfs_btree_path *path, in nilfs_btree_do_lookup() argument
565 path[level].bp_bh = NULL; in nilfs_btree_do_lookup()
566 path[level].bp_index = index; in nilfs_btree_do_lookup()
573 p.node = nilfs_btree_get_node(btree, path, level + 1, in nilfs_btree_do_lookup()
579 ret = __nilfs_btree_get_block(btree, ptr, &path[level].bp_bh, in nilfs_btree_do_lookup()
584 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup()
598 path[level].bp_index = index; in nilfs_btree_do_lookup()
610 struct nilfs_btree_path *path, in nilfs_btree_do_lookup_last() argument
624 path[level].bp_bh = NULL; in nilfs_btree_do_lookup_last()
625 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
629 ret = nilfs_btree_get_block(btree, ptr, &path[level].bp_bh); in nilfs_btree_do_lookup_last()
632 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup_last()
637 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
659 const struct nilfs_btree_path *path, in nilfs_btree_get_next_key() argument
672 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_next_key()
674 index = path[level].bp_index + next_adj; in nilfs_btree_get_next_key()
689 struct nilfs_btree_path *path; in nilfs_btree_lookup() local
692 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup()
693 if (path == NULL) in nilfs_btree_lookup()
696 ret = nilfs_btree_do_lookup(btree, path, key, ptrp, level, 0); in nilfs_btree_lookup()
698 nilfs_btree_free_path(path); in nilfs_btree_lookup()
707 struct nilfs_btree_path *path; in nilfs_btree_lookup_contig() local
716 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup_contig()
717 if (path == NULL) in nilfs_btree_lookup_contig()
720 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level, 1); in nilfs_btree_lookup_contig()
736 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_lookup_contig()
737 index = path[level].bp_index + 1; in nilfs_btree_lookup_contig()
758 p.node = nilfs_btree_get_node(btree, path, level + 1, &p.ncmax); in nilfs_btree_lookup_contig()
759 p.index = path[level + 1].bp_index + 1; in nilfs_btree_lookup_contig()
765 path[level + 1].bp_index = p.index; in nilfs_btree_lookup_contig()
767 brelse(path[level].bp_bh); in nilfs_btree_lookup_contig()
768 path[level].bp_bh = NULL; in nilfs_btree_lookup_contig()
770 ret = __nilfs_btree_get_block(btree, ptr2, &path[level].bp_bh, in nilfs_btree_lookup_contig()
774 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_lookup_contig()
777 path[level].bp_index = index; in nilfs_btree_lookup_contig()
783 nilfs_btree_free_path(path); in nilfs_btree_lookup_contig()
793 struct nilfs_btree_path *path, in nilfs_btree_promote_key() argument
799 nilfs_btree_get_nonroot_node(path, level), in nilfs_btree_promote_key()
800 path[level].bp_index, key); in nilfs_btree_promote_key()
801 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_promote_key()
802 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_promote_key()
803 } while ((path[level].bp_index == 0) && in nilfs_btree_promote_key()
810 path[level].bp_index, key); in nilfs_btree_promote_key()
815 struct nilfs_btree_path *path, in nilfs_btree_do_insert() argument
822 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_insert()
824 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
826 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_insert()
827 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_insert()
829 if (path[level].bp_index == 0) in nilfs_btree_do_insert()
830 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_insert()
835 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
842 struct nilfs_btree_path *path, in nilfs_btree_carry_left() argument
848 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_left()
849 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_left()
856 if (n > path[level].bp_index) { in nilfs_btree_carry_left()
864 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_left()
865 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_left()
866 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_left()
867 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_left()
869 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_left()
873 brelse(path[level].bp_bh); in nilfs_btree_carry_left()
874 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_left()
875 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
876 path[level].bp_index += lnchildren; in nilfs_btree_carry_left()
877 path[level + 1].bp_index--; in nilfs_btree_carry_left()
879 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_left()
880 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
881 path[level].bp_index -= n; in nilfs_btree_carry_left()
884 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_left()
888 struct nilfs_btree_path *path, in nilfs_btree_carry_right() argument
894 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_right()
895 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_right()
902 if (n > nchildren - path[level].bp_index) { in nilfs_btree_carry_right()
910 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_right()
911 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_right()
912 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_right()
913 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_right()
915 path[level + 1].bp_index++; in nilfs_btree_carry_right()
916 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_right()
918 path[level + 1].bp_index--; in nilfs_btree_carry_right()
921 brelse(path[level].bp_bh); in nilfs_btree_carry_right()
922 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_right()
923 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
924 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
925 path[level + 1].bp_index++; in nilfs_btree_carry_right()
927 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_right()
928 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
931 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_right()
935 struct nilfs_btree_path *path, in nilfs_btree_split() argument
941 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_split()
942 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_split()
948 if (n > nchildren - path[level].bp_index) { in nilfs_btree_split()
955 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_split()
956 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_split()
957 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_split()
958 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_split()
961 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
962 nilfs_btree_node_insert(right, path[level].bp_index, in nilfs_btree_split()
966 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
968 brelse(path[level].bp_bh); in nilfs_btree_split()
969 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_split()
970 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
972 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_split()
975 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
977 brelse(path[level].bp_sib_bh); in nilfs_btree_split()
978 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
981 path[level + 1].bp_index++; in nilfs_btree_split()
985 struct nilfs_btree_path *path, in nilfs_btree_grow() argument
992 child = nilfs_btree_get_sib_node(path, level); in nilfs_btree_grow()
1001 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_grow()
1002 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_grow()
1004 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_grow()
1005 path[level].bp_sib_bh = NULL; in nilfs_btree_grow()
1007 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_grow()
1010 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_grow()
1014 const struct nilfs_btree_path *path) in nilfs_btree_find_near() argument
1019 if (path == NULL) in nilfs_btree_find_near()
1024 if (path[level].bp_index > 0) { in nilfs_btree_find_near()
1025 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1027 path[level].bp_index - 1, in nilfs_btree_find_near()
1034 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1035 return nilfs_btree_node_get_ptr(node, path[level].bp_index, in nilfs_btree_find_near()
1043 const struct nilfs_btree_path *path, in nilfs_btree_find_target_v() argument
1053 ptr = nilfs_btree_find_near(btree, path); in nilfs_btree_find_target_v()
1063 struct nilfs_btree_path *path, in nilfs_btree_prepare_insert() argument
1078 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1079 nilfs_btree_find_target_v(btree, path, key); in nilfs_btree_prepare_insert()
1083 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1092 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_insert()
1094 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1099 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_insert()
1100 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_insert()
1111 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1112 path[level].bp_op = nilfs_btree_carry_left; in nilfs_btree_prepare_insert()
1129 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1130 path[level].bp_op = nilfs_btree_carry_right; in nilfs_btree_prepare_insert()
1139 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1140 path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1142 &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1146 path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1155 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1156 path[level].bp_op = nilfs_btree_split; in nilfs_btree_prepare_insert()
1163 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1169 path[level].bp_newreq.bpr_ptr = path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1170 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1173 ret = nilfs_btree_get_new_block(btree, path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1180 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1181 path[level].bp_op = nilfs_btree_grow; in nilfs_btree_prepare_insert()
1184 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1196 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1199 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_prepare_insert()
1200 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1204 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1212 struct nilfs_btree_path *path, in nilfs_btree_commit_insert() argument
1219 ptr = path[NILFS_BTREE_LEVEL_DATA].bp_newreq.bpr_ptr; in nilfs_btree_commit_insert()
1227 &path[level - 1].bp_newreq, dat); in nilfs_btree_commit_insert()
1228 path[level].bp_op(btree, path, level, &key, &ptr); in nilfs_btree_commit_insert()
1237 struct nilfs_btree_path *path; in nilfs_btree_insert() local
1241 path = nilfs_btree_alloc_path(); in nilfs_btree_insert()
1242 if (path == NULL) in nilfs_btree_insert()
1245 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_insert()
1253 ret = nilfs_btree_prepare_insert(btree, path, &level, key, ptr, &stats); in nilfs_btree_insert()
1256 nilfs_btree_commit_insert(btree, path, level, key, ptr); in nilfs_btree_insert()
1260 nilfs_btree_free_path(path); in nilfs_btree_insert()
1265 struct nilfs_btree_path *path, in nilfs_btree_do_delete() argument
1272 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_delete()
1274 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1276 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_delete()
1277 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_delete()
1278 if (path[level].bp_index == 0) in nilfs_btree_do_delete()
1279 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_delete()
1283 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1290 struct nilfs_btree_path *path, in nilfs_btree_borrow_left() argument
1296 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_left()
1298 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_left()
1299 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_left()
1308 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_left()
1309 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_left()
1310 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_left()
1311 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1313 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_left()
1316 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1317 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_left()
1318 path[level].bp_index += n; in nilfs_btree_borrow_left()
1322 struct nilfs_btree_path *path, in nilfs_btree_borrow_right() argument
1328 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_right()
1330 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_right()
1331 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_right()
1340 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_right()
1341 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_right()
1342 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_right()
1343 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1345 path[level + 1].bp_index++; in nilfs_btree_borrow_right()
1346 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_right()
1348 path[level + 1].bp_index--; in nilfs_btree_borrow_right()
1350 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1351 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_right()
1355 struct nilfs_btree_path *path, in nilfs_btree_concat_left() argument
1361 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_left()
1363 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_left()
1364 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_left()
1371 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_concat_left()
1372 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_concat_left()
1374 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_concat_left()
1375 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_concat_left()
1376 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_left()
1377 path[level].bp_index += nilfs_btree_node_get_nchildren(left); in nilfs_btree_concat_left()
1381 struct nilfs_btree_path *path, in nilfs_btree_concat_right() argument
1387 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_right()
1389 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_right()
1390 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_right()
1397 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_concat_right()
1398 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_concat_right()
1400 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_concat_right()
1401 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_right()
1402 path[level + 1].bp_index++; in nilfs_btree_concat_right()
1406 struct nilfs_btree_path *path, in nilfs_btree_shrink() argument
1412 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_shrink()
1415 child = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_shrink()
1425 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_shrink()
1426 path[level].bp_bh = NULL; in nilfs_btree_shrink()
1430 struct nilfs_btree_path *path, in nilfs_btree_nop() argument
1436 struct nilfs_btree_path *path, in nilfs_btree_prepare_delete() argument
1451 for (level = NILFS_BTREE_LEVEL_NODE_MIN, dindex = path[level].bp_index; in nilfs_btree_prepare_delete()
1454 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_delete()
1455 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1458 &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1463 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1468 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_delete()
1469 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_delete()
1481 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1482 path[level].bp_op = nilfs_btree_borrow_left; in nilfs_btree_prepare_delete()
1486 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1487 path[level].bp_op = nilfs_btree_concat_left; in nilfs_btree_prepare_delete()
1501 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1502 path[level].bp_op = nilfs_btree_borrow_right; in nilfs_btree_prepare_delete()
1506 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1507 path[level].bp_op = nilfs_btree_concat_right; in nilfs_btree_prepare_delete()
1525 path[level].bp_op = nilfs_btree_shrink; in nilfs_btree_prepare_delete()
1528 path[level].bp_op = nilfs_btree_nop; in nilfs_btree_prepare_delete()
1531 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1539 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1544 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1548 ret = nilfs_bmap_prepare_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1559 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1562 brelse(path[level].bp_sib_bh); in nilfs_btree_prepare_delete()
1563 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1571 struct nilfs_btree_path *path, in nilfs_btree_commit_delete() argument
1577 nilfs_bmap_commit_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_commit_delete()
1578 path[level].bp_op(btree, path, level, NULL, NULL); in nilfs_btree_commit_delete()
1588 struct nilfs_btree_path *path; in nilfs_btree_delete() local
1593 path = nilfs_btree_alloc_path(); in nilfs_btree_delete()
1594 if (path == NULL) in nilfs_btree_delete()
1597 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_delete()
1605 ret = nilfs_btree_prepare_delete(btree, path, &level, &stats, dat); in nilfs_btree_delete()
1608 nilfs_btree_commit_delete(btree, path, level, dat); in nilfs_btree_delete()
1612 nilfs_btree_free_path(path); in nilfs_btree_delete()
1619 struct nilfs_btree_path *path; in nilfs_btree_seek_key() local
1623 path = nilfs_btree_alloc_path(); in nilfs_btree_seek_key()
1624 if (!path) in nilfs_btree_seek_key()
1627 ret = nilfs_btree_do_lookup(btree, path, start, NULL, minlevel, 0); in nilfs_btree_seek_key()
1631 ret = nilfs_btree_get_next_key(btree, path, minlevel, keyp); in nilfs_btree_seek_key()
1633 nilfs_btree_free_path(path); in nilfs_btree_seek_key()
1639 struct nilfs_btree_path *path; in nilfs_btree_last_key() local
1642 path = nilfs_btree_alloc_path(); in nilfs_btree_last_key()
1643 if (path == NULL) in nilfs_btree_last_key()
1646 ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL); in nilfs_btree_last_key()
1648 nilfs_btree_free_path(path); in nilfs_btree_last_key()
1914 struct nilfs_btree_path *path, in nilfs_btree_propagate_p() argument
1919 !buffer_dirty(path[level].bp_bh)) in nilfs_btree_propagate_p()
1920 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_propagate_p()
1926 struct nilfs_btree_path *path, in nilfs_btree_prepare_update_v() argument
1932 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_update_v()
1933 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_update_v()
1934 nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_prepare_update_v()
1936 path[level].bp_newreq.bpr_ptr = path[level].bp_oldreq.bpr_ptr + 1; in nilfs_btree_prepare_update_v()
1937 ret = nilfs_dat_prepare_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1938 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1942 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_prepare_update_v()
1943 path[level].bp_ctxt.oldkey = path[level].bp_oldreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1944 path[level].bp_ctxt.newkey = path[level].bp_newreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1945 path[level].bp_ctxt.bh = path[level].bp_bh; in nilfs_btree_prepare_update_v()
1948 &path[level].bp_ctxt); in nilfs_btree_prepare_update_v()
1951 &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1952 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1961 struct nilfs_btree_path *path, in nilfs_btree_commit_update_v() argument
1967 nilfs_dat_commit_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_commit_update_v()
1968 &path[level].bp_newreq.bpr_req, in nilfs_btree_commit_update_v()
1971 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_commit_update_v()
1974 &path[level].bp_ctxt); in nilfs_btree_commit_update_v()
1975 path[level].bp_bh = path[level].bp_ctxt.bh; in nilfs_btree_commit_update_v()
1977 set_buffer_nilfs_volatile(path[level].bp_bh); in nilfs_btree_commit_update_v()
1979 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_commit_update_v()
1980 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, in nilfs_btree_commit_update_v()
1981 path[level].bp_newreq.bpr_ptr, ncmax); in nilfs_btree_commit_update_v()
1985 struct nilfs_btree_path *path, in nilfs_btree_abort_update_v() argument
1988 nilfs_dat_abort_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_abort_update_v()
1989 &path[level].bp_newreq.bpr_req); in nilfs_btree_abort_update_v()
1990 if (buffer_nilfs_node(path[level].bp_bh)) in nilfs_btree_abort_update_v()
1993 &path[level].bp_ctxt); in nilfs_btree_abort_update_v()
1997 struct nilfs_btree_path *path, in nilfs_btree_prepare_propagate_v() argument
2004 if (!buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
2005 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2010 !buffer_dirty(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
2012 WARN_ON(buffer_nilfs_volatile(path[level].bp_bh)); in nilfs_btree_prepare_propagate_v()
2013 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2025 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2026 if (!buffer_nilfs_volatile(path[level].bp_bh)) in nilfs_btree_prepare_propagate_v()
2027 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2032 struct nilfs_btree_path *path, in nilfs_btree_commit_propagate_v() argument
2039 if (!buffer_nilfs_volatile(path[minlevel].bp_bh)) in nilfs_btree_commit_propagate_v()
2040 nilfs_btree_commit_update_v(btree, path, minlevel, dat); in nilfs_btree_commit_propagate_v()
2043 nilfs_btree_commit_update_v(btree, path, level, dat); in nilfs_btree_commit_propagate_v()
2047 struct nilfs_btree_path *path, in nilfs_btree_propagate_v() argument
2057 path[level].bp_bh = bh; in nilfs_btree_propagate_v()
2058 ret = nilfs_btree_prepare_propagate_v(btree, path, level, &maxlevel, in nilfs_btree_propagate_v()
2063 if (buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_propagate_v()
2064 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_propagate_v()
2066 path[level + 1].bp_index, in nilfs_btree_propagate_v()
2073 nilfs_btree_commit_propagate_v(btree, path, level, maxlevel, bh, dat); in nilfs_btree_propagate_v()
2076 brelse(path[level].bp_bh); in nilfs_btree_propagate_v()
2077 path[level].bp_bh = NULL; in nilfs_btree_propagate_v()
2084 struct nilfs_btree_path *path; in nilfs_btree_propagate() local
2091 path = nilfs_btree_alloc_path(); in nilfs_btree_propagate()
2092 if (path == NULL) in nilfs_btree_propagate()
2104 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_propagate()
2115 nilfs_btree_propagate_v(btree, path, level, bh) : in nilfs_btree_propagate()
2116 nilfs_btree_propagate_p(btree, path, level, bh); in nilfs_btree_propagate()
2119 nilfs_btree_free_path(path); in nilfs_btree_propagate()
2204 struct nilfs_btree_path *path, in nilfs_btree_assign_p() argument
2215 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_p()
2216 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_p()
2219 path[level].bp_ctxt.oldkey = ptr; in nilfs_btree_assign_p()
2220 path[level].bp_ctxt.newkey = blocknr; in nilfs_btree_assign_p()
2221 path[level].bp_ctxt.bh = *bh; in nilfs_btree_assign_p()
2224 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2229 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2230 *bh = path[level].bp_ctxt.bh; in nilfs_btree_assign_p()
2233 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, blocknr, in nilfs_btree_assign_p()
2236 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_p()
2246 struct nilfs_btree_path *path, in nilfs_btree_assign_v() argument
2259 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_v()
2260 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_v()
2268 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_v()
2281 struct nilfs_btree_path *path; in nilfs_btree_assign() local
2286 path = nilfs_btree_alloc_path(); in nilfs_btree_assign()
2287 if (path == NULL) in nilfs_btree_assign()
2299 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_assign()
2306 nilfs_btree_assign_v(btree, path, level, bh, blocknr, binfo) : in nilfs_btree_assign()
2307 nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo); in nilfs_btree_assign()
2310 nilfs_btree_free_path(path); in nilfs_btree_assign()
2345 struct nilfs_btree_path *path; in nilfs_btree_mark() local
2349 path = nilfs_btree_alloc_path(); in nilfs_btree_mark()
2350 if (path == NULL) in nilfs_btree_mark()
2353 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level + 1, 0); in nilfs_btree_mark()
2371 nilfs_btree_free_path(path); in nilfs_btree_mark()