Skip to content

Commit

Permalink
teamd: get rid of link_watch_handler
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
  • Loading branch information
jpirko committed Aug 7, 2012
1 parent c296f4e commit 1b8dc45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
9 changes: 0 additions & 9 deletions teamd/teamd.h
Expand Up @@ -53,8 +53,6 @@ enum teamd_command {
struct teamd_runner;
struct teamd_context;

typedef int (*teamd_link_watch_handler_t)(struct teamd_context *ctx);

struct teamd_context {
enum teamd_command cmd;
bool daemonize;
Expand All @@ -69,7 +67,6 @@ struct teamd_context {
struct team_handle * th;
const struct teamd_runner * runner;
void * runner_priv;
teamd_link_watch_handler_t link_watch_handler;
struct list_item port_obj_list;
unsigned int port_obj_list_count;
struct list_item option_watch_list;
Expand Down Expand Up @@ -235,12 +232,6 @@ bool teamd_link_watch_port_up(struct teamd_context *ctx,
int teamd_link_watch_init(struct teamd_context *ctx);
void teamd_link_watch_fini(struct teamd_context *ctx);

static inline void teamd_link_watch_set_handler(struct teamd_context *ctx,
teamd_link_watch_handler_t handler)
{
ctx->link_watch_handler = handler;
}

int teamd_option_watch_init(struct teamd_context *ctx);
void teamd_option_watch_fini(struct teamd_context *ctx);

Expand Down
19 changes: 1 addition & 18 deletions teamd/teamd_link_watch.c
Expand Up @@ -196,8 +196,6 @@ lw_psr_ppriv_get(struct lw_common_port_priv *common_ppriv)
return (struct lw_psr_port_priv *) common_ppriv;
}

static int call_link_watch_handler(struct teamd_context *ctx);

static int lw_psr_callback_periodic(struct teamd_context *ctx, int events,
void *func_priv)
{
Expand All @@ -224,9 +222,6 @@ static int lw_psr_callback_periodic(struct teamd_context *ctx, int events,
teamd_log_info("%s: %s-link went %s.", tdport->ifname, lw_name,
psr_ppriv->link_up ? "up" : "down");
err = teamd_event_port_link_changed(ctx, tdport);
if (err)
return err;
err = call_link_watch_handler(ctx);
if (err)
return err;
err = team_set_port_user_linkup(ctx->th,
Expand Down Expand Up @@ -891,13 +886,6 @@ static const struct teamd_link_watch *teamd_find_link_watch(const char *link_wat
return NULL;
}

static int call_link_watch_handler(struct teamd_context *ctx)
{
if (ctx->link_watch_handler)
return ctx->link_watch_handler(ctx);
return 0;
}

bool teamd_link_watch_port_up(struct teamd_context *ctx,
struct teamd_port *tdport)
{
Expand Down Expand Up @@ -970,12 +958,7 @@ static int link_watch_event_watch_port_changed(struct teamd_context *ctx,
struct teamd_port *tdport,
void *priv)
{
int err;

err = teamd_event_port_link_changed(ctx, tdport);
if (err)
return err;
return call_link_watch_handler(ctx);
return teamd_event_port_link_changed(ctx, tdport);
}

static const struct teamd_event_watch_ops link_watch_port_watch_ops = {
Expand Down

0 comments on commit 1b8dc45

Please sign in to comment.