]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/dccp/probe.c
revert "kswapd should only wait on IO if there is IO"
[linux-2.6-omap-h63xx.git] / net / dccp / probe.c
index 146496fce2e2b4c6e40389ecbafc41b6a302ae97..7053bb827bc88c34ca6a47bdcf9644425bc74c25 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/kfifo.h>
 #include <linux/vmalloc.h>
+#include <net/net_namespace.h>
 
 #include "dccp.h"
 #include "ccid.h"
@@ -90,15 +91,18 @@ static int jdccp_sendmsg(struct kiocb *iocb, struct sock *sk,
        if (port == 0 || ntohs(inet->dport) == port ||
            ntohs(inet->sport) == port) {
                if (hctx)
-                       printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %d %d %d %d\n",
-                          NIPQUAD(inet->saddr), ntohs(inet->sport),
-                          NIPQUAD(inet->daddr), ntohs(inet->dport), size,
-                          hctx->ccid3hctx_s, hctx->ccid3hctx_rtt,
-                          hctx->ccid3hctx_p, hctx->ccid3hctx_t_ipi);
+                       printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d %d %d %d %u "
+                              "%llu %llu %d\n",
+                              NIPQUAD(inet->saddr), ntohs(inet->sport),
+                              NIPQUAD(inet->daddr), ntohs(inet->dport), size,
+                              hctx->ccid3hctx_s, hctx->ccid3hctx_rtt,
+                              hctx->ccid3hctx_p, hctx->ccid3hctx_x_calc,
+                              hctx->ccid3hctx_x_recv >> 6,
+                              hctx->ccid3hctx_x >> 6, hctx->ccid3hctx_t_ipi);
                else
                        printl("%d.%d.%d.%d:%u %d.%d.%d.%d:%u %d\n",
-                          NIPQUAD(inet->saddr), ntohs(inet->sport),
-                          NIPQUAD(inet->daddr), ntohs(inet->dport), size);
+                              NIPQUAD(inet->saddr), ntohs(inet->sport),
+                              NIPQUAD(inet->daddr), ntohs(inet->dport), size);
        }
 
        jprobe_return();
@@ -106,8 +110,10 @@ static int jdccp_sendmsg(struct kiocb *iocb, struct sock *sk,
 }
 
 static struct jprobe dccp_send_probe = {
-       .kp     = { .addr = (kprobe_opcode_t *)&dccp_sendmsg, },
-       .entry  = (kprobe_opcode_t *)&jdccp_sendmsg,
+       .kp     = {
+               .symbol_name = "dccp_sendmsg",
+       },
+       .entry  = jdccp_sendmsg,
 };
 
 static int dccpprobe_open(struct inode *inode, struct file *file)
@@ -123,7 +129,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
        int error = 0, cnt = 0;
        unsigned char *tbuf;
 
-       if (!buf || len < 0)
+       if (!buf)
                return -EINVAL;
 
        if (len == 0)
@@ -147,7 +153,7 @@ out_free:
        return error ? error : cnt;
 }
 
-static struct file_operations dccpprobe_fops = {
+static const struct file_operations dccpprobe_fops = {
        .owner   = THIS_MODULE,
        .open    = dccpprobe_open,
        .read    = dccpprobe_read,
@@ -160,8 +166,10 @@ static __init int dccpprobe_init(void)
        init_waitqueue_head(&dccpw.wait);
        spin_lock_init(&dccpw.lock);
        dccpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &dccpw.lock);
+       if (IS_ERR(dccpw.fifo))
+               return PTR_ERR(dccpw.fifo);
 
-       if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops))
+       if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
                goto err0;
 
        ret = register_jprobe(&dccp_send_probe);
@@ -171,7 +179,7 @@ static __init int dccpprobe_init(void)
        pr_info("DCCP watch registered (port=%d)\n", port);
        return 0;
 err1:
-       proc_net_remove(procname);
+       proc_net_remove(&init_net, procname);
 err0:
        kfifo_free(dccpw.fifo);
        return ret;
@@ -181,7 +189,7 @@ module_init(dccpprobe_init);
 static __exit void dccpprobe_exit(void)
 {
        kfifo_free(dccpw.fifo);
-       proc_net_remove(procname);
+       proc_net_remove(&init_net, procname);
        unregister_jprobe(&dccp_send_probe);
 
 }