Skip to contentSkip to conversation

bonding: move procfs code into bond_procfs.c

PATCH Applied Amerigo Wang 4 participants 4 messages Mar 7, 2011 – Mar 9, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 0e2737e..3c5c014 100644
@@ -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
index a401b8d..8e8691a 100644
@@ -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[];
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Mon, Mar 07, 2011 at 08:58:46AM CET, [email protected] wrote:

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

Quoted 9 lines

---

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

maintainer Applied
#3 lore raw

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_FS into bonding.h, as suggested by David.

bond_main.c is bloating, separate the procfs code out, move them to bond_procfs.c

Quoted 6 lines
Quoted 2 lines

Looks good and works as expected.

Applied, thanks everyone.