Lines Matching full: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()
416 nilfs_btree_get_nonroot_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_nonroot_node() argument
418 return (struct nilfs_btree_node *)path[level].bp_bh->b_data; in nilfs_btree_get_nonroot_node()
422 nilfs_btree_get_sib_node(const struct nilfs_btree_path *path, int level) in nilfs_btree_get_sib_node() argument
424 return (struct nilfs_btree_node *)path[level].bp_sib_bh->b_data; in nilfs_btree_get_sib_node()
434 const struct nilfs_btree_path *path, in nilfs_btree_get_node() argument
443 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_node()
538 struct nilfs_btree_path *path, in nilfs_btree_do_lookup() argument
555 path[level].bp_bh = NULL; in nilfs_btree_do_lookup()
556 path[level].bp_index = index; in nilfs_btree_do_lookup()
563 p.node = nilfs_btree_get_node(btree, path, level + 1, in nilfs_btree_do_lookup()
569 ret = __nilfs_btree_get_block(btree, ptr, &path[level].bp_bh, in nilfs_btree_do_lookup()
574 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup()
588 path[level].bp_index = index; in nilfs_btree_do_lookup()
600 struct nilfs_btree_path *path, in nilfs_btree_do_lookup_last() argument
614 path[level].bp_bh = NULL; in nilfs_btree_do_lookup_last()
615 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
619 ret = nilfs_btree_get_block(btree, ptr, &path[level].bp_bh); in nilfs_btree_do_lookup_last()
622 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup_last()
627 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
639 * nilfs_btree_get_next_key - get next valid key from btree path array
641 * @path: array of nilfs_btree_path struct
649 const struct nilfs_btree_path *path, in nilfs_btree_get_next_key() argument
662 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_next_key()
664 index = path[level].bp_index + next_adj; in nilfs_btree_get_next_key()
679 struct nilfs_btree_path *path; in nilfs_btree_lookup() local
682 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup()
683 if (path == NULL) in nilfs_btree_lookup()
686 ret = nilfs_btree_do_lookup(btree, path, key, ptrp, level, 0); in nilfs_btree_lookup()
688 nilfs_btree_free_path(path); in nilfs_btree_lookup()
697 struct nilfs_btree_path *path; in nilfs_btree_lookup_contig() local
706 path = nilfs_btree_alloc_path(); in nilfs_btree_lookup_contig()
707 if (path == NULL) in nilfs_btree_lookup_contig()
710 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level, 1); in nilfs_btree_lookup_contig()
726 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_lookup_contig()
727 index = path[level].bp_index + 1; in nilfs_btree_lookup_contig()
748 p.node = nilfs_btree_get_node(btree, path, level + 1, &p.ncmax); in nilfs_btree_lookup_contig()
749 p.index = path[level + 1].bp_index + 1; in nilfs_btree_lookup_contig()
755 path[level + 1].bp_index = p.index; in nilfs_btree_lookup_contig()
757 brelse(path[level].bp_bh); in nilfs_btree_lookup_contig()
758 path[level].bp_bh = NULL; in nilfs_btree_lookup_contig()
760 ret = __nilfs_btree_get_block(btree, ptr2, &path[level].bp_bh, in nilfs_btree_lookup_contig()
764 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_lookup_contig()
767 path[level].bp_index = index; in nilfs_btree_lookup_contig()
773 nilfs_btree_free_path(path); in nilfs_btree_lookup_contig()
778 struct nilfs_btree_path *path, in nilfs_btree_promote_key() argument
784 nilfs_btree_get_nonroot_node(path, level), in nilfs_btree_promote_key()
785 path[level].bp_index, key); in nilfs_btree_promote_key()
786 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_promote_key()
787 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_promote_key()
788 } while ((path[level].bp_index == 0) && in nilfs_btree_promote_key()
795 path[level].bp_index, key); in nilfs_btree_promote_key()
800 struct nilfs_btree_path *path, in nilfs_btree_do_insert() argument
807 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_insert()
809 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
811 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_insert()
812 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_insert()
814 if (path[level].bp_index == 0) in nilfs_btree_do_insert()
815 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_insert()
820 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
827 struct nilfs_btree_path *path, in nilfs_btree_carry_left() argument
833 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_left()
834 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_left()
841 if (n > path[level].bp_index) { in nilfs_btree_carry_left()
849 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_left()
850 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_left()
851 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_left()
852 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_left()
854 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_left()
858 brelse(path[level].bp_bh); in nilfs_btree_carry_left()
859 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_left()
860 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
861 path[level].bp_index += lnchildren; in nilfs_btree_carry_left()
862 path[level + 1].bp_index--; in nilfs_btree_carry_left()
864 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_left()
865 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_left()
866 path[level].bp_index -= n; in nilfs_btree_carry_left()
869 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_left()
873 struct nilfs_btree_path *path, in nilfs_btree_carry_right() argument
879 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_right()
880 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_carry_right()
887 if (n > nchildren - path[level].bp_index) { in nilfs_btree_carry_right()
895 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_carry_right()
896 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_carry_right()
897 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_carry_right()
898 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_carry_right()
900 path[level + 1].bp_index++; in nilfs_btree_carry_right()
901 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_carry_right()
903 path[level + 1].bp_index--; in nilfs_btree_carry_right()
906 brelse(path[level].bp_bh); in nilfs_btree_carry_right()
907 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_carry_right()
908 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
909 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
910 path[level + 1].bp_index++; in nilfs_btree_carry_right()
912 brelse(path[level].bp_sib_bh); in nilfs_btree_carry_right()
913 path[level].bp_sib_bh = NULL; in nilfs_btree_carry_right()
916 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_carry_right()
920 struct nilfs_btree_path *path, in nilfs_btree_split() argument
926 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_split()
927 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_split()
933 if (n > nchildren - path[level].bp_index) { in nilfs_btree_split()
940 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_split()
941 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_split()
942 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_split()
943 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_split()
946 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
947 nilfs_btree_node_insert(right, path[level].bp_index, in nilfs_btree_split()
951 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
953 brelse(path[level].bp_bh); in nilfs_btree_split()
954 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_split()
955 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
957 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_split()
960 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_split()
962 brelse(path[level].bp_sib_bh); in nilfs_btree_split()
963 path[level].bp_sib_bh = NULL; in nilfs_btree_split()
966 path[level + 1].bp_index++; in nilfs_btree_split()
970 struct nilfs_btree_path *path, in nilfs_btree_grow() argument
977 child = nilfs_btree_get_sib_node(path, level); in nilfs_btree_grow()
986 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_grow()
987 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_grow()
989 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_grow()
990 path[level].bp_sib_bh = NULL; in nilfs_btree_grow()
992 nilfs_btree_do_insert(btree, path, level, keyp, ptrp); in nilfs_btree_grow()
995 *ptrp = path[level].bp_newreq.bpr_ptr; in nilfs_btree_grow()
999 const struct nilfs_btree_path *path) in nilfs_btree_find_near() argument
1004 if (path == NULL) in nilfs_btree_find_near()
1009 if (path[level].bp_index > 0) { in nilfs_btree_find_near()
1010 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1012 path[level].bp_index - 1, in nilfs_btree_find_near()
1019 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
1020 return nilfs_btree_node_get_ptr(node, path[level].bp_index, in nilfs_btree_find_near()
1028 const struct nilfs_btree_path *path, in nilfs_btree_find_target_v() argument
1038 ptr = nilfs_btree_find_near(btree, path); in nilfs_btree_find_target_v()
1048 struct nilfs_btree_path *path, in nilfs_btree_prepare_insert() argument
1063 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1064 nilfs_btree_find_target_v(btree, path, key); in nilfs_btree_prepare_insert()
1068 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1077 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_insert()
1079 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1084 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_insert()
1085 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_insert()
1096 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1097 path[level].bp_op = nilfs_btree_carry_left; in nilfs_btree_prepare_insert()
1114 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1115 path[level].bp_op = nilfs_btree_carry_right; in nilfs_btree_prepare_insert()
1124 path[level].bp_newreq.bpr_ptr = in nilfs_btree_prepare_insert()
1125 path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1127 &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1131 path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1140 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1141 path[level].bp_op = nilfs_btree_split; in nilfs_btree_prepare_insert()
1148 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1154 path[level].bp_newreq.bpr_ptr = path[level - 1].bp_newreq.bpr_ptr + 1; in nilfs_btree_prepare_insert()
1155 ret = nilfs_bmap_prepare_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1158 ret = nilfs_btree_get_new_block(btree, path[level].bp_newreq.bpr_ptr, in nilfs_btree_prepare_insert()
1165 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_insert()
1166 path[level].bp_op = nilfs_btree_grow; in nilfs_btree_prepare_insert()
1169 path[level].bp_op = nilfs_btree_do_insert; in nilfs_btree_prepare_insert()
1181 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1184 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_prepare_insert()
1185 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1189 nilfs_bmap_abort_alloc_ptr(btree, &path[level].bp_newreq, dat); in nilfs_btree_prepare_insert()
1197 struct nilfs_btree_path *path, in nilfs_btree_commit_insert() argument
1204 ptr = path[NILFS_BTREE_LEVEL_DATA].bp_newreq.bpr_ptr; in nilfs_btree_commit_insert()
1212 &path[level - 1].bp_newreq, dat); in nilfs_btree_commit_insert()
1213 path[level].bp_op(btree, path, level, &key, &ptr); in nilfs_btree_commit_insert()
1222 struct nilfs_btree_path *path; in nilfs_btree_insert() local
1226 path = nilfs_btree_alloc_path(); in nilfs_btree_insert()
1227 if (path == NULL) in nilfs_btree_insert()
1230 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_insert()
1238 ret = nilfs_btree_prepare_insert(btree, path, &level, key, ptr, &stats); in nilfs_btree_insert()
1241 nilfs_btree_commit_insert(btree, path, level, key, ptr); in nilfs_btree_insert()
1245 nilfs_btree_free_path(path); in nilfs_btree_insert()
1250 struct nilfs_btree_path *path, in nilfs_btree_do_delete() argument
1257 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_delete()
1259 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1261 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_do_delete()
1262 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_do_delete()
1263 if (path[level].bp_index == 0) in nilfs_btree_do_delete()
1264 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_do_delete()
1268 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1275 struct nilfs_btree_path *path, in nilfs_btree_borrow_left() argument
1281 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_left()
1283 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_left()
1284 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_left()
1293 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_left()
1294 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_left()
1295 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_left()
1296 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1298 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_left()
1301 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_left()
1302 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_left()
1303 path[level].bp_index += n; in nilfs_btree_borrow_left()
1307 struct nilfs_btree_path *path, in nilfs_btree_borrow_right() argument
1313 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_borrow_right()
1315 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_right()
1316 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_borrow_right()
1325 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_borrow_right()
1326 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_borrow_right()
1327 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_borrow_right()
1328 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1330 path[level + 1].bp_index++; in nilfs_btree_borrow_right()
1331 nilfs_btree_promote_key(btree, path, level + 1, in nilfs_btree_borrow_right()
1333 path[level + 1].bp_index--; in nilfs_btree_borrow_right()
1335 brelse(path[level].bp_sib_bh); in nilfs_btree_borrow_right()
1336 path[level].bp_sib_bh = NULL; in nilfs_btree_borrow_right()
1340 struct nilfs_btree_path *path, in nilfs_btree_concat_left() argument
1346 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_left()
1348 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_left()
1349 left = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_left()
1356 if (!buffer_dirty(path[level].bp_sib_bh)) in nilfs_btree_concat_left()
1357 mark_buffer_dirty(path[level].bp_sib_bh); in nilfs_btree_concat_left()
1359 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_concat_left()
1360 path[level].bp_bh = path[level].bp_sib_bh; in nilfs_btree_concat_left()
1361 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_left()
1362 path[level].bp_index += nilfs_btree_node_get_nchildren(left); in nilfs_btree_concat_left()
1366 struct nilfs_btree_path *path, in nilfs_btree_concat_right() argument
1372 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_concat_right()
1374 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_right()
1375 right = nilfs_btree_get_sib_node(path, level); in nilfs_btree_concat_right()
1382 if (!buffer_dirty(path[level].bp_bh)) in nilfs_btree_concat_right()
1383 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_concat_right()
1385 nilfs_btnode_delete(path[level].bp_sib_bh); in nilfs_btree_concat_right()
1386 path[level].bp_sib_bh = NULL; in nilfs_btree_concat_right()
1387 path[level + 1].bp_index++; in nilfs_btree_concat_right()
1391 struct nilfs_btree_path *path, in nilfs_btree_shrink() argument
1397 nilfs_btree_do_delete(btree, path, level, keyp, ptrp); in nilfs_btree_shrink()
1400 child = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_shrink()
1410 nilfs_btnode_delete(path[level].bp_bh); in nilfs_btree_shrink()
1411 path[level].bp_bh = NULL; in nilfs_btree_shrink()
1415 struct nilfs_btree_path *path, in nilfs_btree_nop() argument
1421 struct nilfs_btree_path *path, in nilfs_btree_prepare_delete() argument
1436 for (level = NILFS_BTREE_LEVEL_NODE_MIN, dindex = path[level].bp_index; in nilfs_btree_prepare_delete()
1439 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_delete()
1440 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1443 &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1448 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1453 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_delete()
1454 pindex = path[level + 1].bp_index; in nilfs_btree_prepare_delete()
1466 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1467 path[level].bp_op = nilfs_btree_borrow_left; in nilfs_btree_prepare_delete()
1471 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1472 path[level].bp_op = nilfs_btree_concat_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_borrow_right; in nilfs_btree_prepare_delete()
1491 path[level].bp_sib_bh = bh; in nilfs_btree_prepare_delete()
1492 path[level].bp_op = nilfs_btree_concat_right; in nilfs_btree_prepare_delete()
1510 path[level].bp_op = nilfs_btree_shrink; in nilfs_btree_prepare_delete()
1513 path[level].bp_op = nilfs_btree_nop; in nilfs_btree_prepare_delete()
1516 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1524 path[level].bp_op = nilfs_btree_do_delete; in nilfs_btree_prepare_delete()
1529 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_delete()
1533 ret = nilfs_bmap_prepare_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1544 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1547 brelse(path[level].bp_sib_bh); in nilfs_btree_prepare_delete()
1548 nilfs_bmap_abort_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_prepare_delete()
1556 struct nilfs_btree_path *path, in nilfs_btree_commit_delete() argument
1562 nilfs_bmap_commit_end_ptr(btree, &path[level].bp_oldreq, dat); in nilfs_btree_commit_delete()
1563 path[level].bp_op(btree, path, level, NULL, NULL); in nilfs_btree_commit_delete()
1573 struct nilfs_btree_path *path; in nilfs_btree_delete() local
1578 path = nilfs_btree_alloc_path(); in nilfs_btree_delete()
1579 if (path == NULL) in nilfs_btree_delete()
1582 ret = nilfs_btree_do_lookup(btree, path, key, NULL, in nilfs_btree_delete()
1590 ret = nilfs_btree_prepare_delete(btree, path, &level, &stats, dat); in nilfs_btree_delete()
1593 nilfs_btree_commit_delete(btree, path, level, dat); in nilfs_btree_delete()
1597 nilfs_btree_free_path(path); in nilfs_btree_delete()
1604 struct nilfs_btree_path *path; in nilfs_btree_seek_key() local
1608 path = nilfs_btree_alloc_path(); in nilfs_btree_seek_key()
1609 if (!path) in nilfs_btree_seek_key()
1612 ret = nilfs_btree_do_lookup(btree, path, start, NULL, minlevel, 0); in nilfs_btree_seek_key()
1616 ret = nilfs_btree_get_next_key(btree, path, minlevel, keyp); in nilfs_btree_seek_key()
1618 nilfs_btree_free_path(path); in nilfs_btree_seek_key()
1624 struct nilfs_btree_path *path; in nilfs_btree_last_key() local
1627 path = nilfs_btree_alloc_path(); in nilfs_btree_last_key()
1628 if (path == NULL) in nilfs_btree_last_key()
1631 ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL); in nilfs_btree_last_key()
1633 nilfs_btree_free_path(path); in nilfs_btree_last_key()
1887 struct nilfs_btree_path *path, in nilfs_btree_propagate_p() argument
1892 !buffer_dirty(path[level].bp_bh)) in nilfs_btree_propagate_p()
1893 mark_buffer_dirty(path[level].bp_bh); in nilfs_btree_propagate_p()
1899 struct nilfs_btree_path *path, in nilfs_btree_prepare_update_v() argument
1905 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_prepare_update_v()
1906 path[level].bp_oldreq.bpr_ptr = in nilfs_btree_prepare_update_v()
1907 nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_prepare_update_v()
1909 path[level].bp_newreq.bpr_ptr = path[level].bp_oldreq.bpr_ptr + 1; in nilfs_btree_prepare_update_v()
1910 ret = nilfs_dat_prepare_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1911 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1915 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_prepare_update_v()
1916 path[level].bp_ctxt.oldkey = path[level].bp_oldreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1917 path[level].bp_ctxt.newkey = path[level].bp_newreq.bpr_ptr; in nilfs_btree_prepare_update_v()
1918 path[level].bp_ctxt.bh = path[level].bp_bh; in nilfs_btree_prepare_update_v()
1921 &path[level].bp_ctxt); in nilfs_btree_prepare_update_v()
1924 &path[level].bp_oldreq.bpr_req, in nilfs_btree_prepare_update_v()
1925 &path[level].bp_newreq.bpr_req); in nilfs_btree_prepare_update_v()
1934 struct nilfs_btree_path *path, in nilfs_btree_commit_update_v() argument
1940 nilfs_dat_commit_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_commit_update_v()
1941 &path[level].bp_newreq.bpr_req, in nilfs_btree_commit_update_v()
1944 if (buffer_nilfs_node(path[level].bp_bh)) { in nilfs_btree_commit_update_v()
1947 &path[level].bp_ctxt); in nilfs_btree_commit_update_v()
1948 path[level].bp_bh = path[level].bp_ctxt.bh; in nilfs_btree_commit_update_v()
1950 set_buffer_nilfs_volatile(path[level].bp_bh); in nilfs_btree_commit_update_v()
1952 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_commit_update_v()
1953 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, in nilfs_btree_commit_update_v()
1954 path[level].bp_newreq.bpr_ptr, ncmax); in nilfs_btree_commit_update_v()
1958 struct nilfs_btree_path *path, in nilfs_btree_abort_update_v() argument
1961 nilfs_dat_abort_update(dat, &path[level].bp_oldreq.bpr_req, in nilfs_btree_abort_update_v()
1962 &path[level].bp_newreq.bpr_req); in nilfs_btree_abort_update_v()
1963 if (buffer_nilfs_node(path[level].bp_bh)) in nilfs_btree_abort_update_v()
1966 &path[level].bp_ctxt); in nilfs_btree_abort_update_v()
1970 struct nilfs_btree_path *path, in nilfs_btree_prepare_propagate_v() argument
1977 if (!buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1978 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1983 !buffer_dirty(path[level].bp_bh)) { in nilfs_btree_prepare_propagate_v()
1985 WARN_ON(buffer_nilfs_volatile(path[level].bp_bh)); in nilfs_btree_prepare_propagate_v()
1986 ret = nilfs_btree_prepare_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1998 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
1999 if (!buffer_nilfs_volatile(path[level].bp_bh)) in nilfs_btree_prepare_propagate_v()
2000 nilfs_btree_abort_update_v(btree, path, level, dat); in nilfs_btree_prepare_propagate_v()
2005 struct nilfs_btree_path *path, in nilfs_btree_commit_propagate_v() argument
2012 if (!buffer_nilfs_volatile(path[minlevel].bp_bh)) in nilfs_btree_commit_propagate_v()
2013 nilfs_btree_commit_update_v(btree, path, minlevel, dat); in nilfs_btree_commit_propagate_v()
2016 nilfs_btree_commit_update_v(btree, path, level, dat); in nilfs_btree_commit_propagate_v()
2020 struct nilfs_btree_path *path, in nilfs_btree_propagate_v() argument
2030 path[level].bp_bh = bh; in nilfs_btree_propagate_v()
2031 ret = nilfs_btree_prepare_propagate_v(btree, path, level, &maxlevel, in nilfs_btree_propagate_v()
2036 if (buffer_nilfs_volatile(path[level].bp_bh)) { in nilfs_btree_propagate_v()
2037 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_propagate_v()
2039 path[level + 1].bp_index, in nilfs_btree_propagate_v()
2046 nilfs_btree_commit_propagate_v(btree, path, level, maxlevel, bh, dat); in nilfs_btree_propagate_v()
2049 brelse(path[level].bp_bh); in nilfs_btree_propagate_v()
2050 path[level].bp_bh = NULL; in nilfs_btree_propagate_v()
2057 struct nilfs_btree_path *path; in nilfs_btree_propagate() local
2064 path = nilfs_btree_alloc_path(); in nilfs_btree_propagate()
2065 if (path == NULL) in nilfs_btree_propagate()
2077 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_propagate()
2088 nilfs_btree_propagate_v(btree, path, level, bh) : in nilfs_btree_propagate()
2089 nilfs_btree_propagate_p(btree, path, level, bh); in nilfs_btree_propagate()
2092 nilfs_btree_free_path(path); in nilfs_btree_propagate()
2177 struct nilfs_btree_path *path, in nilfs_btree_assign_p() argument
2188 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_p()
2189 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_p()
2192 path[level].bp_ctxt.oldkey = ptr; in nilfs_btree_assign_p()
2193 path[level].bp_ctxt.newkey = blocknr; in nilfs_btree_assign_p()
2194 path[level].bp_ctxt.bh = *bh; in nilfs_btree_assign_p()
2197 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2202 &path[level].bp_ctxt); in nilfs_btree_assign_p()
2203 *bh = path[level].bp_ctxt.bh; in nilfs_btree_assign_p()
2206 nilfs_btree_node_set_ptr(parent, path[level + 1].bp_index, blocknr, in nilfs_btree_assign_p()
2209 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_p()
2218 struct nilfs_btree_path *path, in nilfs_btree_assign_v() argument
2231 parent = nilfs_btree_get_node(btree, path, level + 1, &ncmax); in nilfs_btree_assign_v()
2232 ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index, in nilfs_btree_assign_v()
2240 key = nilfs_btree_node_get_key(parent, path[level + 1].bp_index); in nilfs_btree_assign_v()
2253 struct nilfs_btree_path *path; in nilfs_btree_assign() local
2258 path = nilfs_btree_alloc_path(); in nilfs_btree_assign()
2259 if (path == NULL) in nilfs_btree_assign()
2271 ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0); in nilfs_btree_assign()
2278 nilfs_btree_assign_v(btree, path, level, bh, blocknr, binfo) : in nilfs_btree_assign()
2279 nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo); in nilfs_btree_assign()
2282 nilfs_btree_free_path(path); in nilfs_btree_assign()
2317 struct nilfs_btree_path *path; in nilfs_btree_mark() local
2321 path = nilfs_btree_alloc_path(); in nilfs_btree_mark()
2322 if (path == NULL) in nilfs_btree_mark()
2325 ret = nilfs_btree_do_lookup(btree, path, key, &ptr, level + 1, 0); in nilfs_btree_mark()
2343 nilfs_btree_free_path(path); in nilfs_btree_mark()