Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314511
b: refs/heads/master
c: 2fcdb2c
h: refs/heads/master
i:
  314509: 38c0dc5
  314507: 72edea3
  314503: fbdec19
  314495: f33d7ae
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 19, 2012
1 parent fa33465 commit 8e3a9a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35b384bd14f91c74e358e02969ee7bb2542e6d78
refs/heads/master: 2fcdb2c9e6598e6ced232eca7aa4a61342691f3b
33 changes: 9 additions & 24 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ static void __team_options_unregister(struct team *team,
}

static void __team_options_change_check(struct team *team);
static void __team_option_inst_change(struct team *team,
struct team_option_inst *opt_inst);

int team_options_register(struct team *team,
const struct team_option *option,
Expand Down Expand Up @@ -360,16 +358,9 @@ static int team_option_set(struct team *team,
struct team_option_inst *opt_inst,
struct team_gsetter_ctx *ctx)
{
int err;

if (!opt_inst->option->setter)
return -EOPNOTSUPP;
err = opt_inst->option->setter(team, ctx);
if (err)
return err;

__team_option_inst_change(team, opt_inst);
return err;
return opt_inst->option->setter(team, ctx);
}

void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info)
Expand Down Expand Up @@ -1750,12 +1741,16 @@ static int team_nl_cmd_options_get(struct sk_buff *skb, struct genl_info *info)
return err;
}

static int team_nl_send_event_options_get(struct team *team,
struct list_head *sel_opt_inst_list);

static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
{
struct team *team;
int err = 0;
int i;
struct nlattr *nl_option;
LIST_HEAD(opt_inst_list);

team = team_nl_team_get(info);
if (!team)
Expand Down Expand Up @@ -1867,13 +1862,17 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
err = team_option_set(team, opt_inst, &ctx);
if (err)
goto team_put;
opt_inst->changed = true;
list_add(&opt_inst->tmp_list, &opt_inst_list);
}
if (!opt_found) {
err = -ENOENT;
goto team_put;
}
}

err = team_nl_send_event_options_get(team, &opt_inst_list);

team_put:
team_nl_team_put(team);

Expand Down Expand Up @@ -2074,20 +2073,6 @@ static void __team_options_change_check(struct team *team)
err);
}

static void __team_option_inst_change(struct team *team,
struct team_option_inst *sel_opt_inst)
{
int err;
LIST_HEAD(sel_opt_inst_list);

sel_opt_inst->changed = true;
list_add(&sel_opt_inst->tmp_list, &sel_opt_inst_list);
err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
if (err)
netdev_warn(team->dev, "Failed to send option change via netlink (err %d)\n",
err);
}

/* rtnl lock is held */
static void __team_port_change_check(struct team_port *port, bool linkup)
{
Expand Down

0 comments on commit 8e3a9a5

Please sign in to comment.