From: Ben Pfaff Date: Thu, 1 Oct 2015 16:22:54 +0000 (-0700) Subject: ovn-controller: Un-inline get_chassis_by_name(). X-Git-Tag: v2.5.0~428 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=2ddf7558f2a726a440bfbfecce5045ec3ebcef08 ovn-controller: Un-inline get_chassis_by_name(). I don't know of any reason to inline this. Also rename for consistency with get_bridge(). Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c index fca243036..b2f2a191a 100644 --- a/ovn/controller/binding.c +++ b/ovn/controller/binding.c @@ -84,7 +84,7 @@ binding_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, return; } - chassis_rec = get_chassis_by_name(ctx->ovnsb_idl, chassis_id); + chassis_rec = get_chassis(ctx->ovnsb_idl, chassis_id); if (!chassis_rec) { return; } @@ -142,7 +142,7 @@ binding_cleanup(struct controller_ctx *ctx, const char *chassis_id) return true; } const struct sbrec_chassis *chassis_rec - = get_chassis_by_name(ctx->ovnsb_idl, chassis_id); + = get_chassis(ctx->ovnsb_idl, chassis_id); if (!chassis_rec) { return true; } diff --git a/ovn/controller/chassis.c b/ovn/controller/chassis.c index 9d6a77ad1..abe2e4df9 100644 --- a/ovn/controller/chassis.c +++ b/ovn/controller/chassis.c @@ -43,7 +43,7 @@ chassis_run(struct controller_ctx *ctx, const char *chassis_id) struct sbrec_encap *encap_rec; static bool inited = false; - chassis_rec = get_chassis_by_name(ctx->ovnsb_idl, chassis_id); + chassis_rec = get_chassis(ctx->ovnsb_idl, chassis_id); /* xxx Need to support more than one encap. Also need to support * xxx encap options. */ @@ -110,7 +110,7 @@ chassis_cleanup(struct controller_ctx *ctx, const char *chassis_id) /* Delete Chassis row. */ const struct sbrec_chassis *chassis_rec - = get_chassis_by_name(ctx->ovnsb_idl, chassis_id); + = get_chassis(ctx->ovnsb_idl, chassis_id); if (!chassis_rec) { return true; } diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index f1bc5246b..0371c3826 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -57,6 +57,20 @@ OVS_NO_RETURN static void usage(void); static char *ovs_remote; +const struct sbrec_chassis * +get_chassis(struct ovsdb_idl *ovnsb_idl, const char *chassis_id) +{ + const struct sbrec_chassis *chassis_rec; + + SBREC_CHASSIS_FOR_EACH(chassis_rec, ovnsb_idl) { + if (!strcmp(chassis_rec->name, chassis_id)) { + break; + } + } + + return chassis_rec; +} + static const struct ovsrec_bridge * get_bridge(struct ovsdb_idl *ovs_idl, const char *br_name) { diff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h index be89b5fb8..9766bc3d2 100644 --- a/ovn/controller/ovn-controller.h +++ b/ovn/controller/ovn-controller.h @@ -27,18 +27,7 @@ struct controller_ctx { struct ovsdb_idl_txn *ovs_idl_txn; }; -static inline const struct sbrec_chassis * -get_chassis_by_name(struct ovsdb_idl *ovnsb_idl, const char *chassis_id) -{ - const struct sbrec_chassis *chassis_rec; - - SBREC_CHASSIS_FOR_EACH(chassis_rec, ovnsb_idl) { - if (!strcmp(chassis_rec->name, chassis_id)) { - break; - } - } - - return chassis_rec; -} +const struct sbrec_chassis *get_chassis(struct ovsdb_idl *, + const char *chassis_id); #endif /* ovn/ovn-controller.h */