]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/sunrpc/xprtsock.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
[mv-sheeva.git] / net / sunrpc / xprtsock.c
index e97e4ca43ef31e79df21257da74f22a480e0053f..02298f529dad3f4a068ed86d4cf00cbe8e352eaf 100644 (file)
@@ -587,13 +587,13 @@ static int xs_udp_send_request(struct rpc_task *task)
        dprintk("RPC:       xs_udp_send_request(%u) = %d\n",
                        xdr->len - req->rq_bytes_sent, status);
 
-       task->tk_bytes_sent += status;
-       if (likely(status >= (int) req->rq_slen))
-               return 0;
-
-       /* Still some bytes left; set up for a retry later. */
-       if (status > 0)
+       if (status >= 0) {
+               task->tk_bytes_sent += status;
+               if (status >= req->rq_slen)
+                       return 0;
+               /* Still some bytes left; set up for a retry later. */
                status = -EAGAIN;
+       }
 
        switch (status) {
        case -ENETUNREACH:
@@ -1350,7 +1350,7 @@ static inline void xs_reclassify_socket4(struct socket *sock)
 {
        struct sock *sk = sock->sk;
 
-       BUG_ON(sk->sk_lock.owner != NULL);
+       BUG_ON(sock_owned_by_user(sk));
        sock_lock_init_class_and_name(sk, "slock-AF_INET-RPC",
                &xs_slock_key[0], "sk_lock-AF_INET-RPC", &xs_key[0]);
 }
@@ -1359,7 +1359,7 @@ static inline void xs_reclassify_socket6(struct socket *sock)
 {
        struct sock *sk = sock->sk;
 
-       BUG_ON(sk->sk_lock.owner != NULL);
+       BUG_ON(sock_owned_by_user(sk));
        sock_lock_init_class_and_name(sk, "slock-AF_INET6-RPC",
                &xs_slock_key[1], "sk_lock-AF_INET6-RPC", &xs_key[1]);
 }