This is ultimately prep work for object reset locking, but valid on it's own: Make object dump routines utilize struct netlink_callback's scratch area for context data. This requires to relocate the s_idx counter, so turn nft_obj_filter into a real context data structure holding also the counter (and the reset boolean as well). Phil Sutter (6): netfilter: nf_tables: Drop pointless memset in nf_tables_dump_obj netfilter: nf_tables: Unconditionally allocate nft_obj_filter netfilter: nf_tables: A better name for nft_obj_filter netfilter: nf_tables: Carry s_idx in nft_obj_dump_ctx netfilter: nf_tables: nft_obj_filter fits into cb->ctx netfilter: nf_tables: Carry reset boolean in nft_obj_dump_ctx net/netfilter/nf_tables_api.c | 66 ++++++++++++++--------------------- 1 file changed, 26 insertions(+), 40 deletions(-) -- 2.41.0