1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 extern struct btree_geo btree_geo128; 3 4 struct btree_head128 { struct btree_head h; }; 5 6 static inline void btree_init_mempool128(struc 7 mempo 8 { 9 btree_init_mempool(&head->h, mempool); 10 } 11 12 static inline int btree_init128(struct btree_h 13 { 14 return btree_init(&head->h); 15 } 16 17 static inline void btree_destroy128(struct btr 18 { 19 btree_destroy(&head->h); 20 } 21 22 static inline void *btree_lookup128(struct btr 23 { 24 u64 key[2] = {k1, k2}; 25 return btree_lookup(&head->h, &btree_g 26 } 27 28 static inline void *btree_get_prev128(struct b 29 u64 *k1, 30 { 31 u64 key[2] = {*k1, *k2}; 32 void *val; 33 34 val = btree_get_prev(&head->h, &btree_ 35 (unsigned long *) 36 *k1 = key[0]; 37 *k2 = key[1]; 38 return val; 39 } 40 41 static inline int btree_insert128(struct btree 42 void *val, g 43 { 44 u64 key[2] = {k1, k2}; 45 return btree_insert(&head->h, &btree_g 46 (unsigned long *)& 47 } 48 49 static inline int btree_update128(struct btree 50 void *val) 51 { 52 u64 key[2] = {k1, k2}; 53 return btree_update(&head->h, &btree_g 54 (unsigned long *)& 55 } 56 57 static inline void *btree_remove128(struct btr 58 { 59 u64 key[2] = {k1, k2}; 60 return btree_remove(&head->h, &btree_g 61 } 62 63 static inline void *btree_last128(struct btree 64 { 65 u64 key[2]; 66 void *val; 67 68 val = btree_last(&head->h, &btree_geo1 69 if (val) { 70 *k1 = key[0]; 71 *k2 = key[1]; 72 } 73 74 return val; 75 } 76 77 static inline int btree_merge128(struct btree_ 78 struct btree_ 79 gfp_t gfp) 80 { 81 return btree_merge(&target->h, &victim 82 } 83 84 void visitor128(void *elem, unsigned long opaq 85 size_t index, void *__func); 86 87 typedef void (*visitor128_t)(void *elem, unsig 88 u64 key1, u64 key 89 90 static inline size_t btree_visitor128(struct b 91 unsigned 92 visitor1 93 { 94 return btree_visitor(&head->h, &btree_ 95 visitor128, func2 96 } 97 98 static inline size_t btree_grim_visitor128(str 99 uns 100 vis 101 { 102 return btree_grim_visitor(&head->h, &b 103 visitor128, 104 } 105 106 #define btree_for_each_safe128(head, k1, k2, v 107 for (val = btree_last128(head, &k1, &k 108 val; 109 val = btree_get_prev128(head, &k1 110 111
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.