* [PATCH net-next] sctp: Don't abort initialization when CONFIG_PROC_FS=n
@ 2008-07-13 13:09 Florian Westphal
2008-07-16 13:35 ` Vlad Yasevich
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2008-07-13 13:09 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: linux-sctp, netdev, Florian Westphal
This puts CONFIG_PROC_FS defines around the proc init/exit functions
and also avoids compiling proc.c if procfs is not supported.
Also make SCTP_DBG_OBJCNT depend on procfs.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
net/sctp/Kconfig | 4 ++--
net/sctp/Makefile | 4 ++--
net/sctp/protocol.c | 11 ++++++++++-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index 0b79f86..7882d36 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -47,11 +47,11 @@ config SCTP_DBG_MSG
config SCTP_DBG_OBJCNT
bool "SCTP: Debug object counts"
+ depends on PROC_FS
help
If you say Y, this will enable debugging support for counting the
type of objects that are currently allocated. This is useful for
- identifying memory leaks. If the /proc filesystem is enabled this
- debug information can be viewed by
+ identifying memory leaks. This debug information can be viewed by
'cat /proc/net/sctp/sctp_dbg_objcnt'
If unsure, say N
diff --git a/net/sctp/Makefile b/net/sctp/Makefile
index f5356b9..6b79473 100644
--- a/net/sctp/Makefile
+++ b/net/sctp/Makefile
@@ -9,10 +9,10 @@ sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
transport.o chunk.o sm_make_chunk.o ulpevent.o \
inqueue.o outqueue.o ulpqueue.o command.o \
tsnmap.o bind_addr.o socket.o primitive.o \
- output.o input.o debug.o ssnmap.o proc.o \
- auth.o
+ output.o input.o debug.o ssnmap.o auth.o
sctp-$(CONFIG_SCTP_DBG_OBJCNT) += objcnt.o
+sctp-$(CONFIG_PROC_FS) += proc.o
sctp-$(CONFIG_SYSCTL) += sysctl.o
sctp-$(subst m,y,$(CONFIG_IPV6)) += ipv6.o
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 9258dfe..db13b58 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -64,9 +64,12 @@
/* Global data structures. */
struct sctp_globals sctp_globals __read_mostly;
-struct proc_dir_entry *proc_net_sctp;
DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics) __read_mostly;
+#ifdef CONFIG_PROC_FS
+struct proc_dir_entry *proc_net_sctp;
+#endif
+
struct idr sctp_assocs_id;
DEFINE_SPINLOCK(sctp_assocs_id_lock);
@@ -97,6 +100,7 @@ struct sock *sctp_get_ctl_sock(void)
/* Set up the proc fs entry for the SCTP protocol. */
static __init int sctp_proc_init(void)
{
+#ifdef CONFIG_PROC_FS
if (!proc_net_sctp) {
struct proc_dir_entry *ent;
ent = proc_mkdir("sctp", init_net.proc_net);
@@ -127,6 +131,9 @@ out_snmp_proc_init:
}
out_nomem:
return -ENOMEM;
+#else
+ return 0;
+#endif /* CONFIG_PROC_FS */
}
/* Clean up the proc fs entry for the SCTP protocol.
@@ -135,6 +142,7 @@ out_nomem:
*/
static void sctp_proc_exit(void)
{
+#ifdef CONFIG_PROC_FS
sctp_snmp_proc_exit();
sctp_eps_proc_exit();
sctp_assocs_proc_exit();
@@ -143,6 +151,7 @@ static void sctp_proc_exit(void)
proc_net_sctp = NULL;
remove_proc_entry("sctp", init_net.proc_net);
}
+#endif
}
/* Private helper to extract ipv4 address and stash them in
--
1.5.3.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] sctp: Don't abort initialization when CONFIG_PROC_FS=n
2008-07-13 13:09 [PATCH net-next] sctp: Don't abort initialization when CONFIG_PROC_FS=n Florian Westphal
@ 2008-07-16 13:35 ` Vlad Yasevich
0 siblings, 0 replies; 2+ messages in thread
From: Vlad Yasevich @ 2008-07-16 13:35 UTC (permalink / raw)
To: Florian Westphal; +Cc: linux-sctp, netdev
Florian Westphal wrote:
> This puts CONFIG_PROC_FS defines around the proc init/exit functions
> and also avoids compiling proc.c if procfs is not supported.
> Also make SCTP_DBG_OBJCNT depend on procfs.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
applied. Thanks.
-vlad
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-16 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-13 13:09 [PATCH net-next] sctp: Don't abort initialization when CONFIG_PROC_FS=n Florian Westphal
2008-07-16 13:35 ` Vlad Yasevich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).