bonding: move procfs code into bond_procfs.c
Subsystems (3)
PATCH v2 1/1 bonding: move procfs code into bond_procfs.c
V2: Move #ifdef CONFIG_PROC_FS into bonding.h, as suggested by David.
bond_main.c is bloating, separate the procfs code out, move them to bond_procfs.c
--- drivers/net/bonding/Makefile | 3 + drivers/net/bonding/bond_main.c | 302 +------------------------------------ drivers/net/bonding/bond_procfs.c | 276 +++++++++++++++++++++++++++++++++ drivers/net/bonding/bonding.h | 26 +++ 4 files changed, 307 insertions(+), 300 deletions(-)
drivers/net/bonding/Makefile +3 -0
@@ -6,6 +6,9 @@ obj-$(CONFIG_BONDING) += bonding.o bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o bond_debugfs.o +proc-$(CONFIG_PROC_FS) += bond_procfs.o +bonding-objs += $(proc-y) + ipv6-$(subst m,y,$(CONFIG_IPV6)) += bond_ipv6.o bonding-objs += $(ipv6-y)
drivers/net/bonding/bond_main.c +2 -300
332 lines not on this page · raw message
drivers/net/bonding/bond_procfs.c new file +276 -0
276 lines not on this page · raw message
drivers/net/bonding/bonding.h +26 -0
@@ -29,6 +29,8 @@#define DRV_NAME "bonding"#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" +#define bond_version DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n" +#define BOND_MAX_ARP_TARGETS 16#define IS_UP (dev) \
@@ -413,6 +415,30 @@ struct bond_net {#endif }; +#ifdef CONFIG_PROC_FS +void bond_create_proc_entry (struct bonding *bond); +void bond_remove_proc_entry (struct bonding *bond); +void bond_create_proc_dir (struct bond_net *bn); +void bond_destroy_proc_dir (struct bond_net *bn); +#else +static inline void bond_create_proc_entry (struct bonding *bond) +{ +} + +static inline void bond_remove_proc_entry (struct bonding *bond) +{ +} + +static inline void bond_create_proc_dir (struct bond_net *bn) +{ +} + +static inline void bond_destroy_proc_dir (struct bond_net *bn) +{ +} +#endif + +/* exported from bond_main.c */ extern int bond_net_id;extern const struct bond_parm_tbl bond_lacp_tbl[];
Quoted 5 lines · Mon, Mar 07, 2011 at 08:58:46AM CET, [email protected] wrote:
V2: Move #ifdef
CONFIG_PROC_FSintobonding.h, as suggested by David.
bond_main.cis bloating, separate the procfs code out, move them tobond_procfs.c
Quoted 9 lines
Signed-off-by WANG Cong <[email protected]>---
drivers/net/bonding/Makefile | 3 + drivers/net/bonding/bond_main.c | 302 +------------------------------------ drivers/net/bonding/bond_procfs.c | 276 +++++++++++++++++++++++++++++++++ drivers/net/bonding/bonding.h | 26 +++ 4 files changed, 307 insertions(+), 300 deletions(-)
Looking good to me
Quoted 7 lines · Amerigo Wang
V2: Move #ifdef
CONFIG_PROC_FSintobonding.h, as suggested by David.
bond_main.cis bloating, separate the procfs code out, move them tobond_procfs.cSigned-off-by WANG Cong <[email protected]>
Looks good and works as expected.
From: Andy Gospodarek <[email protected]>
Date: Mon, 7 Mar 2011 11:17:40 -0500
Quoted 6 lines · Amerigo Wang
Quoted 5 lines
V2: Move #ifdef
CONFIG_PROC_FSintobonding.h, as suggested by David.
bond_main.cis bloating, separate the procfs code out, move them tobond_procfs.c
Quoted 6 lines
Quoted 2 lines
Signed-off-by WANG Cong <[email protected]>Looks good and works as expected.
Signed-off-by Andy Gospodarek <[email protected]>
Applied, thanks everyone.