diff options
Diffstat (limited to 'net/sctp/probe.c')
-rw-r--r-- | net/sctp/probe.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/sctp/probe.c b/net/sctp/probe.c index bc6cd75cc1dc..ad0dba870341 100644 --- a/net/sctp/probe.c +++ b/net/sctp/probe.c | |||
@@ -122,11 +122,12 @@ static const struct file_operations sctpprobe_fops = { | |||
122 | .llseek = noop_llseek, | 122 | .llseek = noop_llseek, |
123 | }; | 123 | }; |
124 | 124 | ||
125 | sctp_disposition_t jsctp_sf_eat_sack(const struct sctp_endpoint *ep, | 125 | static sctp_disposition_t jsctp_sf_eat_sack(struct net *net, |
126 | const struct sctp_association *asoc, | 126 | const struct sctp_endpoint *ep, |
127 | const sctp_subtype_t type, | 127 | const struct sctp_association *asoc, |
128 | void *arg, | 128 | const sctp_subtype_t type, |
129 | sctp_cmd_seq_t *commands) | 129 | void *arg, |
130 | sctp_cmd_seq_t *commands) | ||
130 | { | 131 | { |
131 | struct sctp_transport *sp; | 132 | struct sctp_transport *sp; |
132 | static __u32 lcwnd = 0; | 133 | static __u32 lcwnd = 0; |
@@ -182,13 +183,20 @@ static __init int sctpprobe_init(void) | |||
182 | { | 183 | { |
183 | int ret = -ENOMEM; | 184 | int ret = -ENOMEM; |
184 | 185 | ||
186 | /* Warning: if the function signature of sctp_sf_eat_sack_6_2, | ||
187 | * has been changed, you also have to change the signature of | ||
188 | * jsctp_sf_eat_sack, otherwise you end up right here! | ||
189 | */ | ||
190 | BUILD_BUG_ON(__same_type(sctp_sf_eat_sack_6_2, | ||
191 | jsctp_sf_eat_sack) == 0); | ||
192 | |||
185 | init_waitqueue_head(&sctpw.wait); | 193 | init_waitqueue_head(&sctpw.wait); |
186 | spin_lock_init(&sctpw.lock); | 194 | spin_lock_init(&sctpw.lock); |
187 | if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL)) | 195 | if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL)) |
188 | return ret; | 196 | return ret; |
189 | 197 | ||
190 | if (!proc_net_fops_create(&init_net, procname, S_IRUSR, | 198 | if (!proc_create(procname, S_IRUSR, init_net.proc_net, |
191 | &sctpprobe_fops)) | 199 | &sctpprobe_fops)) |
192 | goto free_kfifo; | 200 | goto free_kfifo; |
193 | 201 | ||
194 | ret = register_jprobe(&sctp_recv_probe); | 202 | ret = register_jprobe(&sctp_recv_probe); |
@@ -200,7 +208,7 @@ static __init int sctpprobe_init(void) | |||
200 | return 0; | 208 | return 0; |
201 | 209 | ||
202 | remove_proc: | 210 | remove_proc: |
203 | proc_net_remove(&init_net, procname); | 211 | remove_proc_entry(procname, init_net.proc_net); |
204 | free_kfifo: | 212 | free_kfifo: |
205 | kfifo_free(&sctpw.fifo); | 213 | kfifo_free(&sctpw.fifo); |
206 | return ret; | 214 | return ret; |
@@ -209,7 +217,7 @@ free_kfifo: | |||
209 | static __exit void sctpprobe_exit(void) | 217 | static __exit void sctpprobe_exit(void) |
210 | { | 218 | { |
211 | kfifo_free(&sctpw.fifo); | 219 | kfifo_free(&sctpw.fifo); |
212 | proc_net_remove(&init_net, procname); | 220 | remove_proc_entry(procname, init_net.proc_net); |
213 | unregister_jprobe(&sctp_recv_probe); | 221 | unregister_jprobe(&sctp_recv_probe); |
214 | } | 222 | } |
215 | 223 | ||