@@ -599,7 +599,6 @@ struct nft_set *nft_set_lookup_global(const struct net *net,
599
599
600
600
struct nft_set_ext * nft_set_catchall_lookup (const struct net * net ,
601
601
const struct nft_set * set );
602
- void * nft_set_catchall_gc (const struct nft_set * set );
603
602
604
603
static inline unsigned long nft_set_gc_interval (const struct nft_set * set )
605
604
{
@@ -816,62 +815,6 @@ void nft_set_elem_destroy(const struct nft_set *set, void *elem,
816
815
void nf_tables_set_elem_destroy (const struct nft_ctx * ctx ,
817
816
const struct nft_set * set , void * elem );
818
817
819
- /**
820
- * struct nft_set_gc_batch_head - nf_tables set garbage collection batch
821
- *
822
- * @rcu: rcu head
823
- * @set: set the elements belong to
824
- * @cnt: count of elements
825
- */
826
- struct nft_set_gc_batch_head {
827
- struct rcu_head rcu ;
828
- const struct nft_set * set ;
829
- unsigned int cnt ;
830
- };
831
-
832
- #define NFT_SET_GC_BATCH_SIZE ((PAGE_SIZE - \
833
- sizeof(struct nft_set_gc_batch_head)) / \
834
- sizeof(void *))
835
-
836
- /**
837
- * struct nft_set_gc_batch - nf_tables set garbage collection batch
838
- *
839
- * @head: GC batch head
840
- * @elems: garbage collection elements
841
- */
842
- struct nft_set_gc_batch {
843
- struct nft_set_gc_batch_head head ;
844
- void * elems [NFT_SET_GC_BATCH_SIZE ];
845
- };
846
-
847
- struct nft_set_gc_batch * nft_set_gc_batch_alloc (const struct nft_set * set ,
848
- gfp_t gfp );
849
- void nft_set_gc_batch_release (struct rcu_head * rcu );
850
-
851
- static inline void nft_set_gc_batch_complete (struct nft_set_gc_batch * gcb )
852
- {
853
- if (gcb != NULL )
854
- call_rcu (& gcb -> head .rcu , nft_set_gc_batch_release );
855
- }
856
-
857
- static inline struct nft_set_gc_batch *
858
- nft_set_gc_batch_check (const struct nft_set * set , struct nft_set_gc_batch * gcb ,
859
- gfp_t gfp )
860
- {
861
- if (gcb != NULL ) {
862
- if (gcb -> head .cnt + 1 < ARRAY_SIZE (gcb -> elems ))
863
- return gcb ;
864
- nft_set_gc_batch_complete (gcb );
865
- }
866
- return nft_set_gc_batch_alloc (set , gfp );
867
- }
868
-
869
- static inline void nft_set_gc_batch_add (struct nft_set_gc_batch * gcb ,
870
- void * elem )
871
- {
872
- gcb -> elems [gcb -> head .cnt ++ ] = elem ;
873
- }
874
-
875
818
struct nft_expr_ops ;
876
819
/**
877
820
* struct nft_expr_type - nf_tables expression type
@@ -1560,47 +1503,12 @@ static inline void nft_set_elem_change_active(const struct net *net,
1560
1503
1561
1504
#endif /* IS_ENABLED(CONFIG_NF_TABLES) */
1562
1505
1563
- /*
1564
- * We use a free bit in the genmask field to indicate the element
1565
- * is busy, meaning it is currently being processed either by
1566
- * the netlink API or GC.
1567
- *
1568
- * Even though the genmask is only a single byte wide, this works
1569
- * because the extension structure if fully constant once initialized,
1570
- * so there are no non-atomic write accesses unless it is already
1571
- * marked busy.
1572
- */
1573
- #define NFT_SET_ELEM_BUSY_MASK (1 << 2)
1574
-
1575
- #if defined(__LITTLE_ENDIAN_BITFIELD )
1576
- #define NFT_SET_ELEM_BUSY_BIT 2
1577
- #elif defined(__BIG_ENDIAN_BITFIELD )
1578
- #define NFT_SET_ELEM_BUSY_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2)
1579
- #else
1580
- #error
1581
- #endif
1582
-
1583
- static inline int nft_set_elem_mark_busy (struct nft_set_ext * ext )
1584
- {
1585
- unsigned long * word = (unsigned long * )ext ;
1586
-
1587
- BUILD_BUG_ON (offsetof(struct nft_set_ext , genmask ) != 0 );
1588
- return test_and_set_bit (NFT_SET_ELEM_BUSY_BIT , word );
1589
- }
1590
-
1591
- static inline void nft_set_elem_clear_busy (struct nft_set_ext * ext )
1592
- {
1593
- unsigned long * word = (unsigned long * )ext ;
1594
-
1595
- clear_bit (NFT_SET_ELEM_BUSY_BIT , word );
1596
- }
1597
-
1598
- #define NFT_SET_ELEM_DEAD_MASK (1 << 3)
1506
+ #define NFT_SET_ELEM_DEAD_MASK (1 << 2)
1599
1507
1600
1508
#if defined(__LITTLE_ENDIAN_BITFIELD )
1601
- #define NFT_SET_ELEM_DEAD_BIT 3
1509
+ #define NFT_SET_ELEM_DEAD_BIT 2
1602
1510
#elif defined(__BIG_ENDIAN_BITFIELD )
1603
- #define NFT_SET_ELEM_DEAD_BIT (BITS_PER_LONG - BITS_PER_BYTE + 3 )
1511
+ #define NFT_SET_ELEM_DEAD_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2 )
1604
1512
#else
1605
1513
#error
1606
1514
#endif
0 commit comments