team: allow async option changes
authorJiri Pirko <jpirko@redhat.com>
Tue, 19 Jun 2012 05:54:11 +0000 (05:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Jun 2012 22:00:23 +0000 (15:00 -0700)
This patch adds two exported functions. One allows to mark option
instance as changed and the second processes change check and does
transfer of changed options to userspace.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c
include/linux/if_team.h

index cff8e253df72341b99f6dff5a05b271ba4924a35..7988ba099b941ea668adac839c739f61b8c7ffae 100644 (file)
@@ -82,6 +82,7 @@ static void team_refresh_port_linkup(struct team_port *port)
                                                   port->state.linkup;
 }
 
+
 /*******************
  * Options handling
  *******************/
@@ -387,6 +388,22 @@ static int team_option_set(struct team *team,
        return err;
 }
 
+void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info)
+{
+       struct team_option_inst *opt_inst;
+
+       opt_inst = container_of(opt_inst_info, struct team_option_inst, info);
+       opt_inst->changed = true;
+}
+EXPORT_SYMBOL(team_option_inst_set_change);
+
+void team_options_change_check(struct team *team)
+{
+       __team_options_change_check(team);
+}
+EXPORT_SYMBOL(team_options_change_check);
+
+
 /****************
  * Mode handling
  ****************/
@@ -2051,6 +2068,7 @@ static void team_port_change_check(struct team_port *port, bool linkup)
        mutex_unlock(&team->lock);
 }
 
+
 /************************************
  * Net device notifier event handler
  ************************************/
index 30854cb0c855b9e69c15350a3879170ad36fee20..2f2972535cc0deae3bdb462e49123ce206344929 100644 (file)
@@ -112,6 +112,9 @@ struct team_option {
        int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
 };
 
+extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info);
+extern void team_options_change_check(struct team *team);
+
 struct team_mode {
        const char *kind;
        struct module *owner;