]> err.no Git - linux-2.6/blobdiff - fs/dlm/lowcomms.c
[NETFILTER]: nf_conntrack: EXPORT_SYMBOL cleanup
[linux-2.6] / fs / dlm / lowcomms.c
index 7ab40422ab578138b1509e5e1729cd40dab5f9d7..6da6b14d5a61b40a83e904e6f56cc19d12865ad2 100644 (file)
@@ -174,7 +174,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr *retaddr)
        return 0;
 }
 
-static struct nodeinfo *nodeid2nodeinfo(int nodeid, int alloc)
+static struct nodeinfo *nodeid2nodeinfo(int nodeid, gfp_t alloc)
 {
        struct nodeinfo *ni;
        int r;
@@ -519,6 +519,7 @@ static int receive_from_sock(void)
        msg.msg_flags = 0;
        msg.msg_control = incmsg;
        msg.msg_controllen = sizeof(incmsg);
+       msg.msg_iovlen = 1;
 
        /* I don't see why this circular buffer stuff is necessary for SCTP
         * which is a packet-based protocol, but the whole thing breaks under
@@ -548,7 +549,7 @@ static int receive_from_sock(void)
        }
        len = iov[0].iov_len + iov[1].iov_len;
 
-       r = ret = kernel_recvmsg(sctp_con.sock, &msg, iov, 1, len,
+       r = ret = kernel_recvmsg(sctp_con.sock, &msg, iov, msg.msg_iovlen, len,
                                 MSG_NOSIGNAL | MSG_DONTWAIT);
        if (ret <= 0)
                goto out_close;
@@ -726,7 +727,7 @@ static int init_sock(void)
 }
 
 
-static struct writequeue_entry *new_writequeue_entry(int allocation)
+static struct writequeue_entry *new_writequeue_entry(gfp_t allocation)
 {
        struct writequeue_entry *entry;
 
@@ -748,7 +749,7 @@ static struct writequeue_entry *new_writequeue_entry(int allocation)
        return entry;
 }
 
-void *dlm_lowcomms_get_buffer(int nodeid, int len, int allocation, char **ppc)
+void *dlm_lowcomms_get_buffer(int nodeid, int len, gfp_t allocation, char **ppc)
 {
        struct writequeue_entry *e;
        int offset = 0;
@@ -934,11 +935,11 @@ static int send_to_sock(struct nodeinfo *ni)
                        break;
                e = list_entry(ni->writequeue.next, struct writequeue_entry,
                               list);
-               kmap(e->page);
                len = e->len;
                offset = e->offset;
                BUG_ON(len == 0 && e->users == 0);
                spin_unlock(&ni->writequeue_lock);
+               kmap(e->page);
 
                ret = 0;
                if (len) {