~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/btree-128.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/btree-128.h (Version linux-6.12-rc7) and /include/linux/btree-128.h (Version linux-6.5.13)


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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php