platform: rename link_change() to link_change_extra()

There are many functions to replace properties of a link
(link_set_address, link_set_mtu, link_set_name, link_change,
etc.). Eventually, they will be replaced by a function that does
everything and removes all the code duplication.

That function will be named link_change(); rename the current
link_change() to link_change_extra().
This commit is contained in:
Beniamino Galvani
2023-02-27 10:55:29 +01:00
parent 24deb07159
commit babe2bacd3
3 changed files with 19 additions and 13 deletions

View File

@@ -8270,7 +8270,7 @@ out:
}
static int
link_change(NMPlatform *platform, NMLinkType type, int ifindex, gconstpointer extra_data)
link_change_extra(NMPlatform *platform, NMLinkType type, int ifindex, gconstpointer extra_data)
{
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
@@ -11166,9 +11166,9 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass)
platform_class->sysctl_set_async = sysctl_set_async;
platform_class->sysctl_get = sysctl_get;
platform_class->link_add = link_add;
platform_class->link_change = link_change;
platform_class->link_delete = link_delete;
platform_class->link_add = link_add;
platform_class->link_change_extra = link_change_extra;
platform_class->link_delete = link_delete;
platform_class->link_refresh = link_refresh;

View File

@@ -1406,7 +1406,10 @@ nm_platform_link_add(NMPlatform *self,
}
int
nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data)
nm_platform_link_change_extra(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data)
{
char buf[512];
const char *name = nm_platform_link_get_name(self, ifindex);
@@ -1447,7 +1450,7 @@ nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpo
buf;
}));
return klass->link_change(self, type, ifindex, extra_data);
return klass->link_change_extra(self, type, ifindex, extra_data);
}
/**

View File

@@ -1093,9 +1093,10 @@ typedef struct {
guint32 mtu,
gconstpointer extra_data,
const NMPlatformLink **out_link);
int (*link_change)(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data);
int (*link_change_extra)(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data);
gboolean (*link_delete)(NMPlatform *self, int ifindex);
gboolean (*link_refresh)(NMPlatform *self, int ifindex);
gboolean (*link_set_netns)(NMPlatform *self, int ifindex, int netns_fd);
@@ -1603,8 +1604,10 @@ int nm_platform_link_add(NMPlatform *self,
gconstpointer extra_data,
const NMPlatformLink **out_link);
int
nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data);
int nm_platform_link_change_extra(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data);
static inline int
nm_platform_link_veth_add(NMPlatform *self,
@@ -1644,13 +1647,13 @@ nm_platform_link_bridge_add(NMPlatform *self,
static inline int
nm_platform_link_bridge_change(NMPlatform *self, int ifindex, const NMPlatformLnkBridge *props)
{
return nm_platform_link_change(self, NM_LINK_TYPE_BRIDGE, ifindex, props);
return nm_platform_link_change_extra(self, NM_LINK_TYPE_BRIDGE, ifindex, props);
}
static inline int
nm_platform_link_bond_change(NMPlatform *self, int ifindex, const NMPlatformLnkBond *props)
{
return nm_platform_link_change(self, NM_LINK_TYPE_BOND, ifindex, props);
return nm_platform_link_change_extra(self, NM_LINK_TYPE_BOND, ifindex, props);
}
static inline int