@@ -562,7 +562,6 @@ struct nft_set *nft_set_lookup_global(const struct net *net,
562562
563563struct nft_set_ext * nft_set_catchall_lookup (const struct net * net ,
564564 const struct nft_set * set );
565- void * nft_set_catchall_gc (const struct nft_set * set );
566565
567566static inline unsigned long nft_set_gc_interval (const struct nft_set * set )
568567{
@@ -779,62 +778,6 @@ void nft_set_elem_destroy(const struct nft_set *set, void *elem,
779778void nf_tables_set_elem_destroy (const struct nft_ctx * ctx ,
780779 const struct nft_set * set , void * elem );
781780
782- /**
783- * struct nft_set_gc_batch_head - nf_tables set garbage collection batch
784- *
785- * @rcu: rcu head
786- * @set: set the elements belong to
787- * @cnt: count of elements
788- */
789- struct nft_set_gc_batch_head {
790- struct rcu_head rcu ;
791- const struct nft_set * set ;
792- unsigned int cnt ;
793- };
794-
795- #define NFT_SET_GC_BATCH_SIZE ((PAGE_SIZE - \
796- sizeof(struct nft_set_gc_batch_head)) / \
797- sizeof(void *))
798-
799- /**
800- * struct nft_set_gc_batch - nf_tables set garbage collection batch
801- *
802- * @head: GC batch head
803- * @elems: garbage collection elements
804- */
805- struct nft_set_gc_batch {
806- struct nft_set_gc_batch_head head ;
807- void * elems [NFT_SET_GC_BATCH_SIZE ];
808- };
809-
810- struct nft_set_gc_batch * nft_set_gc_batch_alloc (const struct nft_set * set ,
811- gfp_t gfp );
812- void nft_set_gc_batch_release (struct rcu_head * rcu );
813-
814- static inline void nft_set_gc_batch_complete (struct nft_set_gc_batch * gcb )
815- {
816- if (gcb != NULL )
817- call_rcu (& gcb -> head .rcu , nft_set_gc_batch_release );
818- }
819-
820- static inline struct nft_set_gc_batch *
821- nft_set_gc_batch_check (const struct nft_set * set , struct nft_set_gc_batch * gcb ,
822- gfp_t gfp )
823- {
824- if (gcb != NULL ) {
825- if (gcb -> head .cnt + 1 < ARRAY_SIZE (gcb -> elems ))
826- return gcb ;
827- nft_set_gc_batch_complete (gcb );
828- }
829- return nft_set_gc_batch_alloc (set , gfp );
830- }
831-
832- static inline void nft_set_gc_batch_add (struct nft_set_gc_batch * gcb ,
833- void * elem )
834- {
835- gcb -> elems [gcb -> head .cnt ++ ] = elem ;
836- }
837-
838781struct nft_expr_ops ;
839782/**
840783 * struct nft_expr_type - nf_tables expression type
@@ -1498,47 +1441,12 @@ static inline void nft_set_elem_change_active(const struct net *net,
14981441
14991442#endif /* IS_ENABLED(CONFIG_NF_TABLES) */
15001443
1501- /*
1502- * We use a free bit in the genmask field to indicate the element
1503- * is busy, meaning it is currently being processed either by
1504- * the netlink API or GC.
1505- *
1506- * Even though the genmask is only a single byte wide, this works
1507- * because the extension structure if fully constant once initialized,
1508- * so there are no non-atomic write accesses unless it is already
1509- * marked busy.
1510- */
1511- #define NFT_SET_ELEM_BUSY_MASK (1 << 2)
1512-
1513- #if defined(__LITTLE_ENDIAN_BITFIELD )
1514- #define NFT_SET_ELEM_BUSY_BIT 2
1515- #elif defined(__BIG_ENDIAN_BITFIELD )
1516- #define NFT_SET_ELEM_BUSY_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2)
1517- #else
1518- #error
1519- #endif
1520-
1521- static inline int nft_set_elem_mark_busy (struct nft_set_ext * ext )
1522- {
1523- unsigned long * word = (unsigned long * )ext ;
1524-
1525- BUILD_BUG_ON (offsetof(struct nft_set_ext , genmask ) != 0 );
1526- return test_and_set_bit (NFT_SET_ELEM_BUSY_BIT , word );
1527- }
1528-
1529- static inline void nft_set_elem_clear_busy (struct nft_set_ext * ext )
1530- {
1531- unsigned long * word = (unsigned long * )ext ;
1532-
1533- clear_bit (NFT_SET_ELEM_BUSY_BIT , word );
1534- }
1535-
1536- #define NFT_SET_ELEM_DEAD_MASK (1 << 3)
1444+ #define NFT_SET_ELEM_DEAD_MASK (1 << 2)
15371445
15381446#if defined(__LITTLE_ENDIAN_BITFIELD )
1539- #define NFT_SET_ELEM_DEAD_BIT 3
1447+ #define NFT_SET_ELEM_DEAD_BIT 2
15401448#elif defined(__BIG_ENDIAN_BITFIELD )
1541- #define NFT_SET_ELEM_DEAD_BIT (BITS_PER_LONG - BITS_PER_BYTE + 3 )
1449+ #define NFT_SET_ELEM_DEAD_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2 )
15421450#else
15431451#error
15441452#endif
0 commit comments