This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / block / nbd.c
index b98b70b..3554188 100644 (file)
@@ -158,12 +158,15 @@ static void nbd_end_request(struct request *req)
 static int sock_xmit(struct socket *sock, int send, void *buf, int size,
                int msg_flags)
 {
+       mm_segment_t oldfs;
        int result;
        struct msghdr msg;
-       struct kvec iov;
+       struct iovec iov;
        unsigned long flags;
        sigset_t oldset;
 
+       oldfs = get_fs();
+       set_fs(get_ds());
        /* Allow interception of SIGKILL only
         * Don't allow other signals to interrupt the transmission */
        spin_lock_irqsave(&current->sighand->siglock, flags);
@@ -179,15 +182,17 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size,
                iov.iov_len = size;
                msg.msg_name = NULL;
                msg.msg_namelen = 0;
+               msg.msg_iov = &iov;
+               msg.msg_iovlen = 1;
                msg.msg_control = NULL;
                msg.msg_controllen = 0;
                msg.msg_namelen = 0;
                msg.msg_flags = msg_flags | MSG_NOSIGNAL;
 
                if (send)
-                       result = kernel_sendmsg(sock, &msg, &iov, 1, size);
+                       result = sock_sendmsg(sock, &msg, size);
                else
-                       result = kernel_recvmsg(sock, &msg, &iov, 1, size, 0);
+                       result = sock_recvmsg(sock, &msg, size, 0);
 
                if (signal_pending(current)) {
                        siginfo_t info;
@@ -214,6 +219,7 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size,
        recalc_sigpending();
        spin_unlock_irqrestore(&current->sighand->siglock, flags);
 
+       set_fs(oldfs);
        return result;
 }