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()
415 nilfs_btree_get_nonroot_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_nonroot_node() argument
417 return (struct nilfs_btree_node *)path[level].bp_bh->b_data; in nilfs_btree_get_nonroot_node()
421 nilfs_btree_get_sib_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_sib_node() argument
423 return (struct nilfs_btree_node *)path[level].bp_sib_bh->b_data; in nilfs_btree_get_sib_node()
433 const struct nilfs_btree_path *path, in nilfs_btree_get_node() argument
442 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_node()
536 struct nilfs_btree_path *path, in nilfs_btree_do_lookup() argument
553 path[level].bp_bh = NULL; in nilfs_btree_do_lookup()
554 path[level].bp_index = index; in nilfs_btree_do_lookup()
561 p.node = nilfs_btree_get_node(btree, path, level + 1, in nilfs_btree_do_lookup()
567 ret = __nilfs_btree_get_block(btree, ptr, &path[level].bp_bh, in nilfs_btree_do_lookup()
572 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup()
586 path[level].bp_index = index; in nilfs_btree_do_lookup()
598 struct nilfs_btree_path *path, in nilfs_btree_do_lookup_last() argument
612 path[level].bp_bh = NULL; in nilfs_btree_do_lookup_last()
613 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
617 ret = nilfs_btree_get_block(btree, ptr, &path[level].bp_bh); in nilfs_btree_do_lookup_last()
620 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup_last()
625 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
647 const struct nilfs_btree_path *path, in nilfs_btree_get_next_key() argument
660 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_next_key()
662 index = path[level].bp_index + next_adj; in nilfs_btree_get_next_key()
677 struct nilfs_btree_path *path; in nilfs_btree_lookup() local
680 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup()
681 if (path == NULL) in nilfs_btree_lookup()
684 ret = nilfs_btree_do_lookup(btree, path, key, ptrp, level, 0); in nilfs_btree_lookup()
686 nilfs_btree_free_path(path); in nilfs_btree_lookup()
695 struct nilfs_btree_path *path; in nilfs_btree_lookup_contig() local
704 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup_contig()
705 if (path == NULL) in nilfs_btree_lookup_contig()
708 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level, 1); in nilfs_btree_lookup_contig()
724 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_lookup_contig()
725 index = path[level].bp_index + 1; in nilfs_btree_lookup_contig()
747 p.node = nilfs_btree_get_node(btree, path, level + 1, &p.ncmax); in nilfs_btree_lookup_contig()
748 p.index = path[level + 1].bp_index + 1; in nilfs_btree_lookup_contig()
754 path[level + 1].bp_index = p.index; in nilfs_btree_lookup_contig()
756 brelse(path[level].bp_bh); in nilfs_btree_lookup_contig()
757 path[level].bp_bh = NULL; in nilfs_btree_lookup_contig()
759 ret = __nilfs_btree_get_block(btree, ptr2, &path[level].bp_bh, in nilfs_btree_lookup_contig()
763 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_lookup_contig()
766 path[level].bp_index = index; in nilfs_btree_lookup_contig()
772 nilfs_btree_free_path(path); in nilfs_btree_lookup_contig()
777 struct nilfs_btree_path *path, in nilfs_btree_promote_key() argument
783 nilfs_btree_get_nonroot_node(path, level), in nilfs_btree_promote_key()
784 path[level].bp_index, key); in nilfs_btree_promote_key()
785 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_promote_key()
786 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_promote_key()
787 } while ((path[level].bp_index == 0) && in nilfs_btree_promote_key()
794 path[level].bp_index, key); in nilfs_btree_promote_key()
799 struct nilfs_btree_path *path, in nilfs_btree_do_insert() argument
806 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_insert()
808 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
810 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_insert()
811 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_insert()
813 if (path[level].bp_index == 0) in nilfs_btree_do_insert()
814 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_insert()
819 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
826 struct nilfs_btree_path *path, in nilfs_btree_carry_left() argument
832 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_left()
833 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_left()
840 if (n > path[level].bp_index) { in nilfs_btree_carry_left()
848 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_left()
849 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_left()
850 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_left()
851 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_left()
853 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_left()
857 brelse(path[level].bp_bh); in nilfs_btree_carry_left()
858 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_left()
859 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
860 path[level].bp_index += lnchildren; in nilfs_btree_carry_left()
861 path[level + 1].bp_index--; in nilfs_btree_carry_left()
863 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_left()
864 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
865 path[level].bp_index -= n; in nilfs_btree_carry_left()
868 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_left()
872 struct nilfs_btree_path *path, in nilfs_btree_carry_right() argument
878 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_right()
879 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_right()
886 if (n > nchildren - path[level].bp_index) { in nilfs_btree_carry_right()
894 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_right()
895 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_right()
896 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_right()
897 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_right()
899 path[level + 1].bp_index++; in nilfs_btree_carry_right()
900 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_right()
902 path[level + 1].bp_index--; in nilfs_btree_carry_right()
905 brelse(path[level].bp_bh); in nilfs_btree_carry_right()
906 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_right()
907 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
908 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
909 path[level + 1].bp_index++; in nilfs_btree_carry_right()
911 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_right()
912 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
915 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_right()
919 struct nilfs_btree_path *path, in nilfs_btree_split() argument
925 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_split()
926 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_split()
932 if (n > nchildren - path[level].bp_index) { in nilfs_btree_split()
939 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_split()
940 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_split()
941 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_split()
942 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_split()
945 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
946 nilfs_btree_node_insert(right, path[level].bp_index, in nilfs_btree_split()
950 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
952 brelse(path[level].bp_bh); in nilfs_btree_split()
953 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_split()
954 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
956 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_split()
959 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
961 brelse(path[level].bp_sib_bh); in nilfs_btree_split()
962 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
965 path[level + 1].bp_index++; in nilfs_btree_split()
969 struct nilfs_btree_path *path, in nilfs_btree_grow() argument
976 child = nilfs_btree_get_sib_node(path, level); in nilfs_btree_grow()
985 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_grow()
986 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_grow()
988 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_grow()
989 path[level].bp_sib_bh = NULL; in nilfs_btree_grow()
991 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_grow()
994 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_grow()
998 const struct nilfs_btree_path *path) in nilfs_btree_find_near() argument
1003 if (path == NULL) in nilfs_btree_find_near()
1008 if (path[level].bp_index > 0) { in nilfs_btree_find_near()
1009 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1011 path[level].bp_index - 1, in nilfs_btree_find_near()
1018 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1019 return nilfs_btree_node_get_ptr(node, path[level].bp_index, in nilfs_btree_find_near()
1027 const struct nilfs_btree_path *path, in nilfs_btree_find_target_v() argument
1037 ptr = nilfs_btree_find_near(btree, path); in nilfs_btree_find_target_v()
1047 struct nilfs_btree_path *path, in nilfs_btree_prepare_insert() argument
1062 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1063 nilfs_btree_find_target_v(btree, path, key); in nilfs_btree_prepare_insert()
1067 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1076 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_insert()
1078 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1083 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_insert()
1084 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_insert()
1095 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1096 path[level].bp_op = nilfs_btree_carry_left; in nilfs_btree_prepare_insert()
1113 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1114 path[level].bp_op = nilfs_btree_carry_right; in nilfs_btree_prepare_insert()
1123 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1124 path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1126 &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1130 path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1139 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1140 path[level].bp_op = nilfs_btree_split; in nilfs_btree_prepare_insert()
1147 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1153 path[level].bp_newreq.bpr_ptr = path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1154 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1157 ret = nilfs_btree_get_new_block(btree, path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1164 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1165 path[level].bp_op = nilfs_btree_grow; in nilfs_btree_prepare_insert()
1168 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1180 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1183 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_prepare_insert()
1184 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1188 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1196 struct nilfs_btree_path *path, in nilfs_btree_commit_insert() argument
1203 ptr = path[NILFS_BTREE_LEVEL_DATA].bp_newreq.bpr_ptr; in nilfs_btree_commit_insert()
1211 &path[level - 1].bp_newreq, dat); in nilfs_btree_commit_insert()
1212 path[level].bp_op(btree, path, level, &key, &ptr); in nilfs_btree_commit_insert()
1221 struct nilfs_btree_path *path; in nilfs_btree_insert() local
1225 path = nilfs_btree_alloc_path(); in nilfs_btree_insert()
1226 if (path == NULL) in nilfs_btree_insert()
1229 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_insert()
1237 ret = nilfs_btree_prepare_insert(btree, path, &level, key, ptr, &stats); in nilfs_btree_insert()
1240 nilfs_btree_commit_insert(btree, path, level, key, ptr); in nilfs_btree_insert()
1244 nilfs_btree_free_path(path); in nilfs_btree_insert()
1249 struct nilfs_btree_path *path, in nilfs_btree_do_delete() argument
1256 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_delete()
1258 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1260 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_delete()
1261 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_delete()
1262 if (path[level].bp_index == 0) in nilfs_btree_do_delete()
1263 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_delete()
1267 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1274 struct nilfs_btree_path *path, in nilfs_btree_borrow_left() argument
1280 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_left()
1282 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_left()
1283 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_left()
1292 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_left()
1293 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_left()
1294 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_left()
1295 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1297 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_left()
1300 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1301 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_left()
1302 path[level].bp_index += n; in nilfs_btree_borrow_left()
1306 struct nilfs_btree_path *path, in nilfs_btree_borrow_right() argument
1312 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_right()
1314 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_right()
1315 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_right()
1324 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_right()
1325 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_right()
1326 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_right()
1327 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1329 path[level + 1].bp_index++; in nilfs_btree_borrow_right()
1330 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_right()
1332 path[level + 1].bp_index--; in nilfs_btree_borrow_right()
1334 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1335 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_right()
1339 struct nilfs_btree_path *path, in nilfs_btree_concat_left() argument
1345 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_left()
1347 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_left()
1348 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_left()
1355 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_concat_left()
1356 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_concat_left()
1358 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_concat_left()
1359 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_concat_left()
1360 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_left()
1361 path[level].bp_index += nilfs_btree_node_get_nchildren(left); in nilfs_btree_concat_left()
1365 struct nilfs_btree_path *path, in nilfs_btree_concat_right() argument
1371 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_right()
1373 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_right()
1374 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_right()
1381 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_concat_right()
1382 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_concat_right()
1384 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_concat_right()
1385 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_right()
1386 path[level + 1].bp_index++; in nilfs_btree_concat_right()
1390 struct nilfs_btree_path *path, in nilfs_btree_shrink() argument
1396 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_shrink()
1399 child = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_shrink()
1409 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_shrink()
1410 path[level].bp_bh = NULL; in nilfs_btree_shrink()
1414 struct nilfs_btree_path *path, in nilfs_btree_nop() argument
1420 struct nilfs_btree_path *path, in nilfs_btree_prepare_delete() argument
1435 for (level = NILFS_BTREE_LEVEL_NODE_MIN, dindex = path[level].bp_index; in nilfs_btree_prepare_delete()
1438 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_delete()
1439 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1442 &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1447 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1452 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_delete()
1453 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_delete()
1465 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1466 path[level].bp_op = nilfs_btree_borrow_left; in nilfs_btree_prepare_delete()
1470 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1471 path[level].bp_op = nilfs_btree_concat_left; in nilfs_btree_prepare_delete()
1485 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1486 path[level].bp_op = nilfs_btree_borrow_right; in nilfs_btree_prepare_delete()
1490 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1491 path[level].bp_op = nilfs_btree_concat_right; in nilfs_btree_prepare_delete()
1509 path[level].bp_op = nilfs_btree_shrink; in nilfs_btree_prepare_delete()
1512 path[level].bp_op = nilfs_btree_nop; in nilfs_btree_prepare_delete()
1515 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1523 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1528 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1532 ret = nilfs_bmap_prepare_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1543 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1546 brelse(path[level].bp_sib_bh); in nilfs_btree_prepare_delete()
1547 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1555 struct nilfs_btree_path *path, in nilfs_btree_commit_delete() argument
1561 nilfs_bmap_commit_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_commit_delete()
1562 path[level].bp_op(btree, path, level, NULL, NULL); in nilfs_btree_commit_delete()
1572 struct nilfs_btree_path *path; in nilfs_btree_delete() local
1577 path = nilfs_btree_alloc_path(); in nilfs_btree_delete()
1578 if (path == NULL) in nilfs_btree_delete()
1581 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_delete()
1589 ret = nilfs_btree_prepare_delete(btree, path, &level, &stats, dat); in nilfs_btree_delete()
1592 nilfs_btree_commit_delete(btree, path, level, dat); in nilfs_btree_delete()
1596 nilfs_btree_free_path(path); in nilfs_btree_delete()
1603 struct nilfs_btree_path *path; in nilfs_btree_seek_key() local
1607 path = nilfs_btree_alloc_path(); in nilfs_btree_seek_key()
1608 if (!path) in nilfs_btree_seek_key()
1611 ret = nilfs_btree_do_lookup(btree, path, start, NULL, minlevel, 0); in nilfs_btree_seek_key()
1615 ret = nilfs_btree_get_next_key(btree, path, minlevel, keyp); in nilfs_btree_seek_key()
1617 nilfs_btree_free_path(path); in nilfs_btree_seek_key()
1623 struct nilfs_btree_path *path; in nilfs_btree_last_key() local
1626 path = nilfs_btree_alloc_path(); in nilfs_btree_last_key()
1627 if (path == NULL) in nilfs_btree_last_key()
1630 ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL); in nilfs_btree_last_key()
1632 nilfs_btree_free_path(path); in nilfs_btree_last_key()
1884 struct nilfs_btree_path *path, in nilfs_btree_propagate_p() argument
1889 !buffer_dirty(path[level].bp_bh)) in nilfs_btree_propagate_p()
1890 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_propagate_p()
1896 struct nilfs_btree_path *path, in nilfs_btree_prepare_update_v() argument
1902 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_update_v()
1903 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_update_v()
1904 nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_prepare_update_v()
1906 path[level].bp_newreq.bpr_ptr = path[level].bp_oldreq.bpr_ptr + 1; in nilfs_btree_prepare_update_v()
1907 ret = nilfs_dat_prepare_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1908 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1912 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_prepare_update_v()
1913 path[level].bp_ctxt.oldkey = path[level].bp_oldreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1914 path[level].bp_ctxt.newkey = path[level].bp_newreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1915 path[level].bp_ctxt.bh = path[level].bp_bh; in nilfs_btree_prepare_update_v()
1918 &path[level].bp_ctxt); in nilfs_btree_prepare_update_v()
1921 &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1922 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1931 struct nilfs_btree_path *path, in nilfs_btree_commit_update_v() argument
1937 nilfs_dat_commit_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_commit_update_v()
1938 &path[level].bp_newreq.bpr_req, in nilfs_btree_commit_update_v()
1941 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_commit_update_v()
1944 &path[level].bp_ctxt); in nilfs_btree_commit_update_v()
1945 path[level].bp_bh = path[level].bp_ctxt.bh; in nilfs_btree_commit_update_v()
1947 set_buffer_nilfs_volatile(path[level].bp_bh); in nilfs_btree_commit_update_v()
1949 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_commit_update_v()
1950 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, in nilfs_btree_commit_update_v()
1951 path[level].bp_newreq.bpr_ptr, ncmax); in nilfs_btree_commit_update_v()
1955 struct nilfs_btree_path *path, in nilfs_btree_abort_update_v() argument
1958 nilfs_dat_abort_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_abort_update_v()
1959 &path[level].bp_newreq.bpr_req); in nilfs_btree_abort_update_v()
1960 if (buffer_nilfs_node(path[level].bp_bh)) in nilfs_btree_abort_update_v()
1963 &path[level].bp_ctxt); in nilfs_btree_abort_update_v()
1967 struct nilfs_btree_path *path, in nilfs_btree_prepare_propagate_v() argument
1974 if (!buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1975 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1980 !buffer_dirty(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1982 WARN_ON(buffer_nilfs_volatile(path[level].bp_bh)); in nilfs_btree_prepare_propagate_v()
1983 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1995 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1996 if (!buffer_nilfs_volatile(path[level].bp_bh)) in nilfs_btree_prepare_propagate_v()
1997 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2002 struct nilfs_btree_path *path, in nilfs_btree_commit_propagate_v() argument
2009 if (!buffer_nilfs_volatile(path[minlevel].bp_bh)) in nilfs_btree_commit_propagate_v()
2010 nilfs_btree_commit_update_v(btree, path, minlevel, dat); in nilfs_btree_commit_propagate_v()
2013 nilfs_btree_commit_update_v(btree, path, level, dat); in nilfs_btree_commit_propagate_v()
2017 struct nilfs_btree_path *path, in nilfs_btree_propagate_v() argument
2027 path[level].bp_bh = bh; in nilfs_btree_propagate_v()
2028 ret = nilfs_btree_prepare_propagate_v(btree, path, level, &maxlevel, in nilfs_btree_propagate_v()
2033 if (buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_propagate_v()
2034 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_propagate_v()
2036 path[level + 1].bp_index, in nilfs_btree_propagate_v()
2043 nilfs_btree_commit_propagate_v(btree, path, level, maxlevel, bh, dat); in nilfs_btree_propagate_v()
2046 brelse(path[level].bp_bh); in nilfs_btree_propagate_v()
2047 path[level].bp_bh = NULL; in nilfs_btree_propagate_v()
2054 struct nilfs_btree_path *path; in nilfs_btree_propagate() local
2061 path = nilfs_btree_alloc_path(); in nilfs_btree_propagate()
2062 if (path == NULL) in nilfs_btree_propagate()
2074 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_propagate()
2085 nilfs_btree_propagate_v(btree, path, level, bh) : in nilfs_btree_propagate()
2086 nilfs_btree_propagate_p(btree, path, level, bh); in nilfs_btree_propagate()
2089 nilfs_btree_free_path(path); in nilfs_btree_propagate()
2173 struct nilfs_btree_path *path, in nilfs_btree_assign_p() argument
2184 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_p()
2185 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_p()
2188 path[level].bp_ctxt.oldkey = ptr; in nilfs_btree_assign_p()
2189 path[level].bp_ctxt.newkey = blocknr; in nilfs_btree_assign_p()
2190 path[level].bp_ctxt.bh = *bh; in nilfs_btree_assign_p()
2193 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2198 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2199 *bh = path[level].bp_ctxt.bh; in nilfs_btree_assign_p()
2202 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, blocknr, in nilfs_btree_assign_p()
2205 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_p()
2214 struct nilfs_btree_path *path, in nilfs_btree_assign_v() argument
2227 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_v()
2228 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_v()
2236 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_v()
2249 struct nilfs_btree_path *path; in nilfs_btree_assign() local
2254 path = nilfs_btree_alloc_path(); in nilfs_btree_assign()
2255 if (path == NULL) in nilfs_btree_assign()
2267 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_assign()
2274 nilfs_btree_assign_v(btree, path, level, bh, blocknr, binfo) : in nilfs_btree_assign()
2275 nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo); in nilfs_btree_assign()
2278 nilfs_btree_free_path(path); in nilfs_btree_assign()
2313 struct nilfs_btree_path *path; in nilfs_btree_mark() local
2317 path = nilfs_btree_alloc_path(); in nilfs_btree_mark()
2318 if (path == NULL) in nilfs_btree_mark()
2321 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level + 1, 0); in nilfs_btree_mark()
2339 nilfs_btree_free_path(path); in nilfs_btree_mark()