]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: use reference counting action init
authorVlad Buslov <vladbu@mellanox.com>
Thu, 5 Jul 2018 14:24:31 +0000 (17:24 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jul 2018 03:42:29 +0000 (12:42 +0900)
commit89007e836c726f3ff4592e55ca12d1fd8010a6c3
tree1bc0e47b7a5217a4694d4b9a09be5aefb870b3b4
parentbca2d6466f163d03ca3e60535b468f925a864321
net: sched: use reference counting action init

Change action API to assume that action init function always takes
reference to action, even when overwriting existing action. This is
necessary because action API continues to use action pointer after init
function is done. At this point action becomes accessible for concurrent
modifications, so user must always hold reference to it.

Implement helper put list function to atomically release list of actions
after action API init code is done using them.

Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c