~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to net/unix/af_unix.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
1915
1915
                struct sk_buff *skb;
1916
1916
 
1917
1917
                unix_state_lock(sk);
1918
 
                skb = skb_dequeue(&sk->sk_receive_queue);
 
1918
                skb = skb_peek(&sk->sk_receive_queue);
1919
1919
                if (skb == NULL) {
1920
1920
                        unix_sk(sk)->recursion_level = 0;
1921
1921
                        if (copied >= target)
1955
1955
                if (check_creds) {
1956
1956
                        /* Never glue messages from different writers */
1957
1957
                        if ((UNIXCB(skb).pid  != siocb->scm->pid) ||
1958
 
                            (UNIXCB(skb).cred != siocb->scm->cred)) {
1959
 
                                skb_queue_head(&sk->sk_receive_queue, skb);
1960
 
                                sk->sk_data_ready(sk, skb->len);
 
1958
                            (UNIXCB(skb).cred != siocb->scm->cred))
1961
1959
                                break;
1962
 
                        }
1963
1960
                } else {
1964
1961
                        /* Copy credentials */
1965
1962
                        scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred);
1974
1971
 
1975
1972
                chunk = min_t(unsigned int, skb->len, size);
1976
1973
                if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) {
1977
 
                        skb_queue_head(&sk->sk_receive_queue, skb);
1978
 
                        sk->sk_data_ready(sk, skb->len);
1979
1974
                        if (copied == 0)
1980
1975
                                copied = -EFAULT;
1981
1976
                        break;
1990
1985
                        if (UNIXCB(skb).fp)
1991
1986
                                unix_detach_fds(siocb->scm, skb);
1992
1987
 
1993
 
                        /* put the skb back if we didn't use it up.. */
1994
 
                        if (skb->len) {
1995
 
                                skb_queue_head(&sk->sk_receive_queue, skb);
1996
 
                                sk->sk_data_ready(sk, skb->len);
 
1988
                        if (skb->len)
1997
1989
                                break;
1998
 
                        }
1999
1990
 
 
1991
                        skb_unlink(skb, &sk->sk_receive_queue);
2000
1992
                        consume_skb(skb);
2001
1993
 
2002
1994
                        if (siocb->scm->fp)
2007
1999
                        if (UNIXCB(skb).fp)
2008
2000
                                siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
2009
2001
 
2010
 
                        /* put message back and return */
2011
 
                        skb_queue_head(&sk->sk_receive_queue, skb);
2012
 
                        sk->sk_data_ready(sk, skb->len);
2013
2002
                        break;
2014
2003
                }
2015
2004
        } while (size);