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()
746 p.node = nilfs_btree_get_node(btree, path, level + 1, &p.ncmax); in nilfs_btree_lookup_contig()
747 p.index = path[level + 1].bp_index + 1; in nilfs_btree_lookup_contig()
753 path[level + 1].bp_index = p.index; in nilfs_btree_lookup_contig()
755 brelse(path[level].bp_bh); in nilfs_btree_lookup_contig()
756 path[level].bp_bh = NULL; in nilfs_btree_lookup_contig()
758 ret = __nilfs_btree_get_block(btree, ptr2, &path[level].bp_bh, in nilfs_btree_lookup_contig()
762 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_lookup_contig()
765 path[level].bp_index = index; in nilfs_btree_lookup_contig()
771 nilfs_btree_free_path(path); in nilfs_btree_lookup_contig()
776 struct nilfs_btree_path *path, in nilfs_btree_promote_key() argument
782 nilfs_btree_get_nonroot_node(path, level), in nilfs_btree_promote_key()
783 path[level].bp_index, key); in nilfs_btree_promote_key()
784 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_promote_key()
785 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_promote_key()
786 } while ((path[level].bp_index == 0) && in nilfs_btree_promote_key()
793 path[level].bp_index, key); in nilfs_btree_promote_key()
798 struct nilfs_btree_path *path, in nilfs_btree_do_insert() argument
805 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_insert()
807 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
809 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_insert()
810 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_insert()
812 if (path[level].bp_index == 0) in nilfs_btree_do_insert()
813 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_insert()
818 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
825 struct nilfs_btree_path *path, in nilfs_btree_carry_left() argument
831 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_left()
832 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_left()
839 if (n > path[level].bp_index) { in nilfs_btree_carry_left()
847 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_left()
848 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_left()
849 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_left()
850 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_left()
852 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_left()
856 brelse(path[level].bp_bh); in nilfs_btree_carry_left()
857 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_left()
858 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
859 path[level].bp_index += lnchildren; in nilfs_btree_carry_left()
860 path[level + 1].bp_index--; in nilfs_btree_carry_left()
862 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_left()
863 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
864 path[level].bp_index -= n; in nilfs_btree_carry_left()
867 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_left()
871 struct nilfs_btree_path *path, in nilfs_btree_carry_right() argument
877 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_right()
878 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_right()
885 if (n > nchildren - path[level].bp_index) { in nilfs_btree_carry_right()
893 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_right()
894 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_right()
895 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_right()
896 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_right()
898 path[level + 1].bp_index++; in nilfs_btree_carry_right()
899 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_right()
901 path[level + 1].bp_index--; in nilfs_btree_carry_right()
904 brelse(path[level].bp_bh); in nilfs_btree_carry_right()
905 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_right()
906 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
907 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
908 path[level + 1].bp_index++; in nilfs_btree_carry_right()
910 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_right()
911 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
914 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_right()
918 struct nilfs_btree_path *path, in nilfs_btree_split() argument
924 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_split()
925 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_split()
931 if (n > nchildren - path[level].bp_index) { in nilfs_btree_split()
938 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_split()
939 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_split()
940 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_split()
941 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_split()
944 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
945 nilfs_btree_node_insert(right, path[level].bp_index, in nilfs_btree_split()
949 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
951 brelse(path[level].bp_bh); in nilfs_btree_split()
952 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_split()
953 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
955 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_split()
958 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
960 brelse(path[level].bp_sib_bh); in nilfs_btree_split()
961 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
964 path[level + 1].bp_index++; in nilfs_btree_split()
968 struct nilfs_btree_path *path, in nilfs_btree_grow() argument
975 child = nilfs_btree_get_sib_node(path, level); in nilfs_btree_grow()
984 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_grow()
985 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_grow()
987 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_grow()
988 path[level].bp_sib_bh = NULL; in nilfs_btree_grow()
990 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_grow()
993 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_grow()
997 const struct nilfs_btree_path *path) in nilfs_btree_find_near() argument
1002 if (path == NULL) in nilfs_btree_find_near()
1007 if (path[level].bp_index > 0) { in nilfs_btree_find_near()
1008 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1010 path[level].bp_index - 1, in nilfs_btree_find_near()
1017 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1018 return nilfs_btree_node_get_ptr(node, path[level].bp_index, in nilfs_btree_find_near()
1026 const struct nilfs_btree_path *path, in nilfs_btree_find_target_v() argument
1036 ptr = nilfs_btree_find_near(btree, path); in nilfs_btree_find_target_v()
1046 struct nilfs_btree_path *path, in nilfs_btree_prepare_insert() argument
1061 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1062 nilfs_btree_find_target_v(btree, path, key); in nilfs_btree_prepare_insert()
1066 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1075 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_insert()
1077 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1082 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_insert()
1083 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_insert()
1094 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1095 path[level].bp_op = nilfs_btree_carry_left; in nilfs_btree_prepare_insert()
1112 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1113 path[level].bp_op = nilfs_btree_carry_right; in nilfs_btree_prepare_insert()
1122 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1123 path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1125 &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1129 path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1138 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1139 path[level].bp_op = nilfs_btree_split; in nilfs_btree_prepare_insert()
1146 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1152 path[level].bp_newreq.bpr_ptr = path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1153 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1156 ret = nilfs_btree_get_new_block(btree, path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1163 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1164 path[level].bp_op = nilfs_btree_grow; in nilfs_btree_prepare_insert()
1167 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1179 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1182 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_prepare_insert()
1183 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1187 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1195 struct nilfs_btree_path *path, in nilfs_btree_commit_insert() argument
1202 ptr = path[NILFS_BTREE_LEVEL_DATA].bp_newreq.bpr_ptr; in nilfs_btree_commit_insert()
1210 &path[level - 1].bp_newreq, dat); in nilfs_btree_commit_insert()
1211 path[level].bp_op(btree, path, level, &key, &ptr); in nilfs_btree_commit_insert()
1220 struct nilfs_btree_path *path; in nilfs_btree_insert() local
1224 path = nilfs_btree_alloc_path(); in nilfs_btree_insert()
1225 if (path == NULL) in nilfs_btree_insert()
1228 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_insert()
1236 ret = nilfs_btree_prepare_insert(btree, path, &level, key, ptr, &stats); in nilfs_btree_insert()
1239 nilfs_btree_commit_insert(btree, path, level, key, ptr); in nilfs_btree_insert()
1243 nilfs_btree_free_path(path); in nilfs_btree_insert()
1248 struct nilfs_btree_path *path, in nilfs_btree_do_delete() argument
1255 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_delete()
1257 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1259 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_delete()
1260 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_delete()
1261 if (path[level].bp_index == 0) in nilfs_btree_do_delete()
1262 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_delete()
1266 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1273 struct nilfs_btree_path *path, in nilfs_btree_borrow_left() argument
1279 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_left()
1281 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_left()
1282 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_left()
1291 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_left()
1292 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_left()
1293 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_left()
1294 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1296 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_left()
1299 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1300 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_left()
1301 path[level].bp_index += n; in nilfs_btree_borrow_left()
1305 struct nilfs_btree_path *path, in nilfs_btree_borrow_right() argument
1311 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_right()
1313 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_right()
1314 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_right()
1323 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_right()
1324 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_right()
1325 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_right()
1326 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1328 path[level + 1].bp_index++; in nilfs_btree_borrow_right()
1329 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_right()
1331 path[level + 1].bp_index--; in nilfs_btree_borrow_right()
1333 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1334 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_right()
1338 struct nilfs_btree_path *path, in nilfs_btree_concat_left() argument
1344 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_left()
1346 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_left()
1347 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_left()
1354 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_concat_left()
1355 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_concat_left()
1357 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_concat_left()
1358 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_concat_left()
1359 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_left()
1360 path[level].bp_index += nilfs_btree_node_get_nchildren(left); in nilfs_btree_concat_left()
1364 struct nilfs_btree_path *path, in nilfs_btree_concat_right() argument
1370 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_right()
1372 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_right()
1373 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_right()
1380 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_concat_right()
1381 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_concat_right()
1383 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_concat_right()
1384 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_right()
1385 path[level + 1].bp_index++; in nilfs_btree_concat_right()
1389 struct nilfs_btree_path *path, in nilfs_btree_shrink() argument
1395 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_shrink()
1398 child = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_shrink()
1408 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_shrink()
1409 path[level].bp_bh = NULL; in nilfs_btree_shrink()
1413 struct nilfs_btree_path *path, in nilfs_btree_nop() argument
1419 struct nilfs_btree_path *path, in nilfs_btree_prepare_delete() argument
1434 for (level = NILFS_BTREE_LEVEL_NODE_MIN, dindex = path[level].bp_index; in nilfs_btree_prepare_delete()
1437 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_delete()
1438 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1441 &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1446 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1451 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_delete()
1452 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_delete()
1464 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1465 path[level].bp_op = nilfs_btree_borrow_left; in nilfs_btree_prepare_delete()
1469 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1470 path[level].bp_op = nilfs_btree_concat_left; in nilfs_btree_prepare_delete()
1484 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1485 path[level].bp_op = nilfs_btree_borrow_right; in nilfs_btree_prepare_delete()
1489 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1490 path[level].bp_op = nilfs_btree_concat_right; in nilfs_btree_prepare_delete()
1508 path[level].bp_op = nilfs_btree_shrink; in nilfs_btree_prepare_delete()
1511 path[level].bp_op = nilfs_btree_nop; in nilfs_btree_prepare_delete()
1514 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1522 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1527 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1531 ret = nilfs_bmap_prepare_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1542 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1545 brelse(path[level].bp_sib_bh); in nilfs_btree_prepare_delete()
1546 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1554 struct nilfs_btree_path *path, in nilfs_btree_commit_delete() argument
1560 nilfs_bmap_commit_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_commit_delete()
1561 path[level].bp_op(btree, path, level, NULL, NULL); in nilfs_btree_commit_delete()
1571 struct nilfs_btree_path *path; in nilfs_btree_delete() local
1576 path = nilfs_btree_alloc_path(); in nilfs_btree_delete()
1577 if (path == NULL) in nilfs_btree_delete()
1580 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_delete()
1588 ret = nilfs_btree_prepare_delete(btree, path, &level, &stats, dat); in nilfs_btree_delete()
1591 nilfs_btree_commit_delete(btree, path, level, dat); in nilfs_btree_delete()
1595 nilfs_btree_free_path(path); in nilfs_btree_delete()
1602 struct nilfs_btree_path *path; in nilfs_btree_seek_key() local
1606 path = nilfs_btree_alloc_path(); in nilfs_btree_seek_key()
1607 if (!path) in nilfs_btree_seek_key()
1610 ret = nilfs_btree_do_lookup(btree, path, start, NULL, minlevel, 0); in nilfs_btree_seek_key()
1614 ret = nilfs_btree_get_next_key(btree, path, minlevel, keyp); in nilfs_btree_seek_key()
1616 nilfs_btree_free_path(path); in nilfs_btree_seek_key()
1622 struct nilfs_btree_path *path; in nilfs_btree_last_key() local
1625 path = nilfs_btree_alloc_path(); in nilfs_btree_last_key()
1626 if (path == NULL) in nilfs_btree_last_key()
1629 ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL); in nilfs_btree_last_key()
1631 nilfs_btree_free_path(path); in nilfs_btree_last_key()
1883 struct nilfs_btree_path *path, in nilfs_btree_propagate_p() argument
1888 !buffer_dirty(path[level].bp_bh)) in nilfs_btree_propagate_p()
1889 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_propagate_p()
1895 struct nilfs_btree_path *path, in nilfs_btree_prepare_update_v() argument
1901 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_update_v()
1902 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_update_v()
1903 nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_prepare_update_v()
1905 path[level].bp_newreq.bpr_ptr = path[level].bp_oldreq.bpr_ptr + 1; in nilfs_btree_prepare_update_v()
1906 ret = nilfs_dat_prepare_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1907 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1911 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_prepare_update_v()
1912 path[level].bp_ctxt.oldkey = path[level].bp_oldreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1913 path[level].bp_ctxt.newkey = path[level].bp_newreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1914 path[level].bp_ctxt.bh = path[level].bp_bh; in nilfs_btree_prepare_update_v()
1917 &path[level].bp_ctxt); in nilfs_btree_prepare_update_v()
1920 &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1921 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1930 struct nilfs_btree_path *path, in nilfs_btree_commit_update_v() argument
1936 nilfs_dat_commit_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_commit_update_v()
1937 &path[level].bp_newreq.bpr_req, in nilfs_btree_commit_update_v()
1940 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_commit_update_v()
1943 &path[level].bp_ctxt); in nilfs_btree_commit_update_v()
1944 path[level].bp_bh = path[level].bp_ctxt.bh; in nilfs_btree_commit_update_v()
1946 set_buffer_nilfs_volatile(path[level].bp_bh); in nilfs_btree_commit_update_v()
1948 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_commit_update_v()
1949 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, in nilfs_btree_commit_update_v()
1950 path[level].bp_newreq.bpr_ptr, ncmax); in nilfs_btree_commit_update_v()
1954 struct nilfs_btree_path *path, in nilfs_btree_abort_update_v() argument
1957 nilfs_dat_abort_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_abort_update_v()
1958 &path[level].bp_newreq.bpr_req); in nilfs_btree_abort_update_v()
1959 if (buffer_nilfs_node(path[level].bp_bh)) in nilfs_btree_abort_update_v()
1962 &path[level].bp_ctxt); in nilfs_btree_abort_update_v()
1966 struct nilfs_btree_path *path, in nilfs_btree_prepare_propagate_v() argument
1973 if (!buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1974 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1979 !buffer_dirty(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1981 WARN_ON(buffer_nilfs_volatile(path[level].bp_bh)); in nilfs_btree_prepare_propagate_v()
1982 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1994 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1995 if (!buffer_nilfs_volatile(path[level].bp_bh)) in nilfs_btree_prepare_propagate_v()
1996 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2001 struct nilfs_btree_path *path, in nilfs_btree_commit_propagate_v() argument
2008 if (!buffer_nilfs_volatile(path[minlevel].bp_bh)) in nilfs_btree_commit_propagate_v()
2009 nilfs_btree_commit_update_v(btree, path, minlevel, dat); in nilfs_btree_commit_propagate_v()
2012 nilfs_btree_commit_update_v(btree, path, level, dat); in nilfs_btree_commit_propagate_v()
2016 struct nilfs_btree_path *path, in nilfs_btree_propagate_v() argument
2026 path[level].bp_bh = bh; in nilfs_btree_propagate_v()
2027 ret = nilfs_btree_prepare_propagate_v(btree, path, level, &maxlevel, in nilfs_btree_propagate_v()
2032 if (buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_propagate_v()
2033 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_propagate_v()
2035 path[level + 1].bp_index, in nilfs_btree_propagate_v()
2042 nilfs_btree_commit_propagate_v(btree, path, level, maxlevel, bh, dat); in nilfs_btree_propagate_v()
2045 brelse(path[level].bp_bh); in nilfs_btree_propagate_v()
2046 path[level].bp_bh = NULL; in nilfs_btree_propagate_v()
2053 struct nilfs_btree_path *path; in nilfs_btree_propagate() local
2060 path = nilfs_btree_alloc_path(); in nilfs_btree_propagate()
2061 if (path == NULL) in nilfs_btree_propagate()
2073 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_propagate()
2084 nilfs_btree_propagate_v(btree, path, level, bh) : in nilfs_btree_propagate()
2085 nilfs_btree_propagate_p(btree, path, level, bh); in nilfs_btree_propagate()
2088 nilfs_btree_free_path(path); in nilfs_btree_propagate()
2172 struct nilfs_btree_path *path, in nilfs_btree_assign_p() argument
2183 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_p()
2184 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_p()
2187 path[level].bp_ctxt.oldkey = ptr; in nilfs_btree_assign_p()
2188 path[level].bp_ctxt.newkey = blocknr; in nilfs_btree_assign_p()
2189 path[level].bp_ctxt.bh = *bh; in nilfs_btree_assign_p()
2192 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2197 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2198 *bh = path[level].bp_ctxt.bh; in nilfs_btree_assign_p()
2201 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, blocknr, in nilfs_btree_assign_p()
2204 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_p()
2213 struct nilfs_btree_path *path, in nilfs_btree_assign_v() argument
2226 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_v()
2227 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_v()
2235 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_v()
2248 struct nilfs_btree_path *path; in nilfs_btree_assign() local
2253 path = nilfs_btree_alloc_path(); in nilfs_btree_assign()
2254 if (path == NULL) in nilfs_btree_assign()
2266 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_assign()
2273 nilfs_btree_assign_v(btree, path, level, bh, blocknr, binfo) : in nilfs_btree_assign()
2274 nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo); in nilfs_btree_assign()
2277 nilfs_btree_free_path(path); in nilfs_btree_assign()
2312 struct nilfs_btree_path *path; in nilfs_btree_mark() local
2316 path = nilfs_btree_alloc_path(); in nilfs_btree_mark()
2317 if (path == NULL) in nilfs_btree_mark()
2320 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level + 1, 0); in nilfs_btree_mark()
2338 nilfs_btree_free_path(path); in nilfs_btree_mark()