Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: Kill bch2_bset_fix_invalidated_key()

Was dead code, so delete it.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>

authored by

Kent Overstreet and committed by
Kent Overstreet
17563164 6558e61d

+7 -121
+7 -120
fs/bcachefs/bset.c
··· 595 595 } 596 596 597 597 __always_inline 598 - static inline void __make_bfloat(struct btree *b, struct bset_tree *t, 599 - unsigned j, 600 - struct bkey_packed *min_key, 601 - struct bkey_packed *max_key) 598 + static inline void make_bfloat(struct btree *b, struct bset_tree *t, 599 + unsigned j, 600 + struct bkey_packed *min_key, 601 + struct bkey_packed *max_key) 602 602 { 603 603 struct bkey_float *f = bkey_float(b, t, j); 604 604 struct bkey_packed *m = tree_to_bkey(b, t, j); ··· 665 665 mantissa |= ~(~0U << -exponent); 666 666 667 667 f->mantissa = mantissa; 668 - } 669 - 670 - static void make_bfloat(struct btree *b, struct bset_tree *t, 671 - unsigned j, 672 - struct bkey_packed *min_key, 673 - struct bkey_packed *max_key) 674 - { 675 - struct bkey_i *k; 676 - 677 - if (is_power_of_2(j) && 678 - !min_key->u64s) { 679 - if (!bkey_pack_pos(min_key, b->data->min_key, b)) { 680 - k = (void *) min_key; 681 - bkey_init(&k->k); 682 - k->k.p = b->data->min_key; 683 - } 684 - } 685 - 686 - if (is_power_of_2(j + 1) && 687 - !max_key->u64s) { 688 - if (!bkey_pack_pos(max_key, b->data->max_key, b)) { 689 - k = (void *) max_key; 690 - bkey_init(&k->k); 691 - k->k.p = b->data->max_key; 692 - } 693 - } 694 - 695 - __make_bfloat(b, t, j, min_key, max_key); 696 668 } 697 669 698 670 /* bytes remaining - only valid for last bset: */ ··· 756 784 757 785 /* Then we build the tree */ 758 786 eytzinger1_for_each(j, t->size) 759 - __make_bfloat(b, t, j, 760 - bkey_to_packed(&min_key), 761 - bkey_to_packed(&max_key)); 787 + make_bfloat(b, t, j, 788 + bkey_to_packed(&min_key), 789 + bkey_to_packed(&max_key)); 762 790 } 763 791 764 792 static void bset_alloc_tree(struct btree *b, struct bset_tree *t) ··· 902 930 } 903 931 904 932 /* Insert */ 905 - 906 - static void rw_aux_tree_fix_invalidated_key(struct btree *b, 907 - struct bset_tree *t, 908 - struct bkey_packed *k) 909 - { 910 - unsigned offset = __btree_node_key_to_offset(b, k); 911 - unsigned j = rw_aux_tree_bsearch(b, t, offset); 912 - 913 - if (j < t->size && 914 - rw_aux_tree(b, t)[j].offset == offset) 915 - rw_aux_tree_set(b, t, j, k); 916 - 917 - bch2_bset_verify_rw_aux_tree(b, t); 918 - } 919 - 920 - static void ro_aux_tree_fix_invalidated_key(struct btree *b, 921 - struct bset_tree *t, 922 - struct bkey_packed *k) 923 - { 924 - struct bkey_packed min_key, max_key; 925 - unsigned inorder, j; 926 - 927 - EBUG_ON(bset_aux_tree_type(t) != BSET_RO_AUX_TREE); 928 - 929 - /* signal to make_bfloat() that they're uninitialized: */ 930 - min_key.u64s = max_key.u64s = 0; 931 - 932 - if (bkey_next(k) == btree_bkey_last(b, t)) { 933 - for (j = 1; j < t->size; j = j * 2 + 1) 934 - make_bfloat(b, t, j, &min_key, &max_key); 935 - } 936 - 937 - inorder = bkey_to_cacheline(b, t, k); 938 - 939 - if (inorder && 940 - inorder < t->size) { 941 - j = __inorder_to_eytzinger1(inorder, t->size, t->extra); 942 - 943 - if (k == tree_to_bkey(b, t, j)) { 944 - /* Fix the node this key corresponds to */ 945 - make_bfloat(b, t, j, &min_key, &max_key); 946 - 947 - /* Children for which this key is the right boundary */ 948 - for (j = eytzinger1_left_child(j); 949 - j < t->size; 950 - j = eytzinger1_right_child(j)) 951 - make_bfloat(b, t, j, &min_key, &max_key); 952 - } 953 - } 954 - 955 - if (inorder + 1 < t->size) { 956 - j = __inorder_to_eytzinger1(inorder + 1, t->size, t->extra); 957 - 958 - if (k == tree_to_prev_bkey(b, t, j)) { 959 - make_bfloat(b, t, j, &min_key, &max_key); 960 - 961 - /* Children for which this key is the left boundary */ 962 - for (j = eytzinger1_right_child(j); 963 - j < t->size; 964 - j = eytzinger1_left_child(j)) 965 - make_bfloat(b, t, j, &min_key, &max_key); 966 - } 967 - } 968 - } 969 - 970 - /** 971 - * bch2_bset_fix_invalidated_key() - given an existing key @k that has been 972 - * modified, fix any auxiliary search tree by remaking all the nodes in the 973 - * auxiliary search tree that @k corresponds to 974 - */ 975 - void bch2_bset_fix_invalidated_key(struct btree *b, struct bkey_packed *k) 976 - { 977 - struct bset_tree *t = bch2_bkey_to_bset_inlined(b, k); 978 - 979 - switch (bset_aux_tree_type(t)) { 980 - case BSET_NO_AUX_TREE: 981 - break; 982 - case BSET_RO_AUX_TREE: 983 - ro_aux_tree_fix_invalidated_key(b, t, k); 984 - break; 985 - case BSET_RW_AUX_TREE: 986 - rw_aux_tree_fix_invalidated_key(b, t, k); 987 - break; 988 - } 989 - } 990 933 991 934 static void bch2_bset_fix_lookup_table(struct btree *b, 992 935 struct bset_tree *t,
-1
fs/bcachefs/bset.h
··· 361 361 void bch2_bset_init_next(struct bch_fs *, struct btree *, 362 362 struct btree_node_entry *); 363 363 void bch2_bset_build_aux_tree(struct btree *, struct bset_tree *, bool); 364 - void bch2_bset_fix_invalidated_key(struct btree *, struct bkey_packed *); 365 364 366 365 void bch2_bset_insert(struct btree *, struct btree_node_iter *, 367 366 struct bkey_packed *, struct bkey_i *, unsigned);