@@ -320,8 +320,6 @@ static void __team_options_unregister(struct team *team,
320
320
}
321
321
322
322
static void __team_options_change_check (struct team * team );
323
- static void __team_option_inst_change (struct team * team ,
324
- struct team_option_inst * opt_inst );
325
323
326
324
int team_options_register (struct team * team ,
327
325
const struct team_option * option ,
@@ -360,16 +358,9 @@ static int team_option_set(struct team *team,
360
358
struct team_option_inst * opt_inst ,
361
359
struct team_gsetter_ctx * ctx )
362
360
{
363
- int err ;
364
-
365
361
if (!opt_inst -> option -> setter )
366
362
return - EOPNOTSUPP ;
367
- err = opt_inst -> option -> setter (team , ctx );
368
- if (err )
369
- return err ;
370
-
371
- __team_option_inst_change (team , opt_inst );
372
- return err ;
363
+ return opt_inst -> option -> setter (team , ctx );
373
364
}
374
365
375
366
void team_option_inst_set_change (struct team_option_inst_info * opt_inst_info )
@@ -1750,12 +1741,16 @@ static int team_nl_cmd_options_get(struct sk_buff *skb, struct genl_info *info)
1750
1741
return err ;
1751
1742
}
1752
1743
1744
+ static int team_nl_send_event_options_get (struct team * team ,
1745
+ struct list_head * sel_opt_inst_list );
1746
+
1753
1747
static int team_nl_cmd_options_set (struct sk_buff * skb , struct genl_info * info )
1754
1748
{
1755
1749
struct team * team ;
1756
1750
int err = 0 ;
1757
1751
int i ;
1758
1752
struct nlattr * nl_option ;
1753
+ LIST_HEAD (opt_inst_list );
1759
1754
1760
1755
team = team_nl_team_get (info );
1761
1756
if (!team )
@@ -1867,13 +1862,17 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
1867
1862
err = team_option_set (team , opt_inst , & ctx );
1868
1863
if (err )
1869
1864
goto team_put ;
1865
+ opt_inst -> changed = true;
1866
+ list_add (& opt_inst -> tmp_list , & opt_inst_list );
1870
1867
}
1871
1868
if (!opt_found ) {
1872
1869
err = - ENOENT ;
1873
1870
goto team_put ;
1874
1871
}
1875
1872
}
1876
1873
1874
+ err = team_nl_send_event_options_get (team , & opt_inst_list );
1875
+
1877
1876
team_put :
1878
1877
team_nl_team_put (team );
1879
1878
@@ -2074,20 +2073,6 @@ static void __team_options_change_check(struct team *team)
2074
2073
err );
2075
2074
}
2076
2075
2077
- static void __team_option_inst_change (struct team * team ,
2078
- struct team_option_inst * sel_opt_inst )
2079
- {
2080
- int err ;
2081
- LIST_HEAD (sel_opt_inst_list );
2082
-
2083
- sel_opt_inst -> changed = true;
2084
- list_add (& sel_opt_inst -> tmp_list , & sel_opt_inst_list );
2085
- err = team_nl_send_event_options_get (team , & sel_opt_inst_list );
2086
- if (err )
2087
- netdev_warn (team -> dev , "Failed to send option change via netlink (err %d)\n" ,
2088
- err );
2089
- }
2090
-
2091
2076
/* rtnl lock is held */
2092
2077
static void __team_port_change_check (struct team_port * port , bool linkup )
2093
2078
{
0 commit comments