diff options
author | Ying Xue <ying.xue@windriver.com> | 2018-02-14 13:37:59 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 14:46:32 -0500 |
commit | d59d8b77abf4308e9c6809298341e275eac38404 (patch) | |
tree | e3b367d235995cabbad494a573ef2889ae08c6e5 /net/tipc | |
parent | e5d1a1eec0f4b51d0a7a6457d0b1b99b34f3e901 (diff) | |
download | op-kernel-dev-d59d8b77abf4308e9c6809298341e275eac38404.zip op-kernel-dev-d59d8b77abf4308e9c6809298341e275eac38404.tar.gz |
tipc: Introduce __tipc_nl_bearer_disable
Introduce __tipc_nl_bearer_disable() which doesn't hold RTNL lock.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 19 | ||||
-rw-r--r-- | net/tipc/bearer.h | 1 |
2 files changed, 14 insertions, 6 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index c800147..61b6625 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -813,7 +813,7 @@ err_out: return err; } -int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) +int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) { int err; char *name; @@ -835,19 +835,26 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) name = nla_data(attrs[TIPC_NLA_BEARER_NAME]); - rtnl_lock(); bearer = tipc_bearer_find(net, name); - if (!bearer) { - rtnl_unlock(); + if (!bearer) return -EINVAL; - } bearer_disable(net, bearer); - rtnl_unlock(); return 0; } +int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info) +{ + int err; + + rtnl_lock(); + err = __tipc_nl_bearer_disable(skb, info); + rtnl_unlock(); + + return err; +} + int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info) { int err; diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 42d6eee..bcc6d5f 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h @@ -188,6 +188,7 @@ extern struct tipc_media udp_media_info; #endif int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); +int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info); int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info); int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb); int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info); |