diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-13 14:39:59 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-14 10:40:16 +0200 |
commit | 96f51428c43de20723630f0d756a7a9a42cbd974 (patch) | |
tree | e091eedd03dafcb68da9fb00fc2cf4db00b50483 /net/netfilter/ipset/ip_set_bitmap_port.c | |
parent | netfilter: ipset: Prepare the ipset core to use RCU at set level (diff) | |
download | linux-dev-96f51428c43de20723630f0d756a7a9a42cbd974.tar.xz linux-dev-96f51428c43de20723630f0d756a7a9a42cbd974.zip |
netfilter: ipset: Introduce RCU locking in bitmap:* types
There's nothing much required because the bitmap types use atomic
bit operations. However the logic of adding elements slightly changed:
first the MAC address updated (which is not atomic), then the element
activated (added). The extensions may call kfree_rcu() therefore we
call rcu_barrier() at module removal.
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'net/netfilter/ipset/ip_set_bitmap_port.c')
-rw-r--r-- | net/netfilter/ipset/ip_set_bitmap_port.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_bitmap_port.c b/net/netfilter/ipset/ip_set_bitmap_port.c index ec3bda1ec90e..2d360f951d18 100644 --- a/net/netfilter/ipset/ip_set_bitmap_port.c +++ b/net/netfilter/ipset/ip_set_bitmap_port.c @@ -73,7 +73,7 @@ static inline int bitmap_port_do_add(const struct bitmap_port_adt_elem *e, struct bitmap_port *map, u32 flags, size_t dsize) { - return !!test_and_set_bit(e->id, map->members); + return !!test_bit(e->id, map->members); } static inline int @@ -306,6 +306,7 @@ bitmap_port_init(void) static void __exit bitmap_port_fini(void) { + rcu_barrier(); ip_set_type_unregister(&bitmap_port_type); } |