Commit 1c2197c4 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

devlink: extend devlink_nl_put_nested_handle() with attrtype arg

As the next patch is going to call this helper with need to fill another
type of nested attribute, pass it over function arg.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af1f1400
...@@ -146,7 +146,7 @@ devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink) ...@@ -146,7 +146,7 @@ devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink)
} }
int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net, int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
struct devlink *devlink); struct devlink *devlink, int attrtype);
int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info); int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info);
/* Notify */ /* Notify */
......
...@@ -114,7 +114,8 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg, ...@@ -114,7 +114,8 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg,
if (linecard->nested_devlink && if (linecard->nested_devlink &&
devlink_nl_put_nested_handle(msg, devlink_net(devlink), devlink_nl_put_nested_handle(msg, devlink_net(devlink),
linecard->nested_devlink)) linecard->nested_devlink,
DEVLINK_ATTR_NESTED_DEVLINK))
goto nla_put_failure; goto nla_put_failure;
genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
......
...@@ -83,11 +83,11 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = { ...@@ -83,11 +83,11 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = {
}; };
int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net, int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
struct devlink *devlink) struct devlink *devlink, int attrtype)
{ {
struct nlattr *nested_attr; struct nlattr *nested_attr;
nested_attr = nla_nest_start(msg, DEVLINK_ATTR_NESTED_DEVLINK); nested_attr = nla_nest_start(msg, attrtype);
if (!nested_attr) if (!nested_attr)
return -EMSGSIZE; return -EMSGSIZE;
if (devlink_nl_put_handle(msg, devlink)) if (devlink_nl_put_handle(msg, devlink))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment