OSDN Git Service

net: sched: refactor tcf_block_find() into standalone functions
authorVlad Buslov <vladbu@mellanox.com>
Mon, 11 Feb 2019 08:55:47 +0000 (10:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 18:41:33 +0000 (13:41 -0500)
commit18d3eefb17cf1959bedb4f8cbb76b6aa05657776
treef9e3a685f3b226ec7e27917c12f9d0ea0b8c1b25
parentdfcd2a2b2274ec029699be70ea0fe41a7a03f728
net: sched: refactor tcf_block_find() into standalone functions

Refactor tcf_block_find() code into three standalone functions:
- __tcf_qdisc_find() to lookup Qdisc and increment its reference counter.
- __tcf_qdisc_cl_find() to lookup class.
- __tcf_block_find() to lookup block and increment its reference counter.

This change is necessary to allow netlink tc rule update handlers to call
these functions directly in order to conditionally take rtnl lock
according to Qdisc class ops flags before calling any of class ops
functions.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c