diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 46 | ||||
-rw-r--r-- | net/unix/garbage.c | 14 |
2 files changed, 30 insertions, 30 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 2f208c7f4d43..ac9478d0ca8b 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -195,7 +195,7 @@ static inline void unix_release_addr(struct unix_address *addr) | |||
195 | * - if started by not zero, should be NULL terminated (FS object) | 195 | * - if started by not zero, should be NULL terminated (FS object) |
196 | * - if started by zero, it is abstract name. | 196 | * - if started by zero, it is abstract name. |
197 | */ | 197 | */ |
198 | 198 | ||
199 | static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp) | 199 | static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp) |
200 | { | 200 | { |
201 | if (len <= sizeof(short) || len > sizeof(*sunaddr)) | 201 | if (len <= sizeof(short) || len > sizeof(*sunaddr)) |
@@ -432,7 +432,7 @@ static int unix_release_sock (struct sock *sk, int embrion) | |||
432 | */ | 432 | */ |
433 | 433 | ||
434 | if (atomic_read(&unix_tot_inflight)) | 434 | if (atomic_read(&unix_tot_inflight)) |
435 | unix_gc(); /* Garbage collect fds */ | 435 | unix_gc(); /* Garbage collect fds */ |
436 | 436 | ||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
@@ -698,7 +698,7 @@ static struct sock *unix_find_other(struct sockaddr_un *sunname, int len, | |||
698 | struct sock *u; | 698 | struct sock *u; |
699 | struct nameidata nd; | 699 | struct nameidata nd; |
700 | int err = 0; | 700 | int err = 0; |
701 | 701 | ||
702 | if (sunname->sun_path[0]) { | 702 | if (sunname->sun_path[0]) { |
703 | err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd); | 703 | err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd); |
704 | if (err) | 704 | if (err) |
@@ -915,7 +915,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, | |||
915 | unix_peer(sk)=other; | 915 | unix_peer(sk)=other; |
916 | unix_state_wunlock(sk); | 916 | unix_state_wunlock(sk); |
917 | } | 917 | } |
918 | return 0; | 918 | return 0; |
919 | 919 | ||
920 | out_unlock: | 920 | out_unlock: |
921 | unix_state_wunlock(sk); | 921 | unix_state_wunlock(sk); |
@@ -1021,7 +1021,7 @@ restart: | |||
1021 | goto out; | 1021 | goto out; |
1022 | sock_put(other); | 1022 | sock_put(other); |
1023 | goto restart; | 1023 | goto restart; |
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | /* Latch our state. | 1026 | /* Latch our state. |
1027 | 1027 | ||
@@ -1415,7 +1415,7 @@ out: | |||
1415 | return err; | 1415 | return err; |
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | 1418 | ||
1419 | static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | 1419 | static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, |
1420 | struct msghdr *msg, size_t len) | 1420 | struct msghdr *msg, size_t len) |
1421 | { | 1421 | { |
@@ -1467,11 +1467,11 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1467 | 1467 | ||
1468 | if (size > SKB_MAX_ALLOC) | 1468 | if (size > SKB_MAX_ALLOC) |
1469 | size = SKB_MAX_ALLOC; | 1469 | size = SKB_MAX_ALLOC; |
1470 | 1470 | ||
1471 | /* | 1471 | /* |
1472 | * Grab a buffer | 1472 | * Grab a buffer |
1473 | */ | 1473 | */ |
1474 | 1474 | ||
1475 | skb=sock_alloc_send_skb(sk,size,msg->msg_flags&MSG_DONTWAIT, &err); | 1475 | skb=sock_alloc_send_skb(sk,size,msg->msg_flags&MSG_DONTWAIT, &err); |
1476 | 1476 | ||
1477 | if (skb==NULL) | 1477 | if (skb==NULL) |
@@ -1530,7 +1530,7 @@ static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1530 | { | 1530 | { |
1531 | int err; | 1531 | int err; |
1532 | struct sock *sk = sock->sk; | 1532 | struct sock *sk = sock->sk; |
1533 | 1533 | ||
1534 | err = sock_error(sk); | 1534 | err = sock_error(sk); |
1535 | if (err) | 1535 | if (err) |
1536 | return err; | 1536 | return err; |
@@ -1543,7 +1543,7 @@ static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1543 | 1543 | ||
1544 | return unix_dgram_sendmsg(kiocb, sock, msg, len); | 1544 | return unix_dgram_sendmsg(kiocb, sock, msg, len); |
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | static void unix_copy_addr(struct msghdr *msg, struct sock *sk) | 1547 | static void unix_copy_addr(struct msghdr *msg, struct sock *sk) |
1548 | { | 1548 | { |
1549 | struct unix_sock *u = unix_sk(sk); | 1549 | struct unix_sock *u = unix_sk(sk); |
@@ -1605,7 +1605,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1605 | if (UNIXCB(skb).fp) | 1605 | if (UNIXCB(skb).fp) |
1606 | unix_detach_fds(siocb->scm, skb); | 1606 | unix_detach_fds(siocb->scm, skb); |
1607 | } | 1607 | } |
1608 | else | 1608 | else |
1609 | { | 1609 | { |
1610 | /* It is questionable: on PEEK we could: | 1610 | /* It is questionable: on PEEK we could: |
1611 | - do not return fds - good, but too simple 8) | 1611 | - do not return fds - good, but too simple 8) |
@@ -1613,11 +1613,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1613 | apparently wrong) | 1613 | apparently wrong) |
1614 | - clone fds (I chose it for now, it is the most universal | 1614 | - clone fds (I chose it for now, it is the most universal |
1615 | solution) | 1615 | solution) |
1616 | 1616 | ||
1617 | POSIX 1003.1g does not actually define this clearly | 1617 | POSIX 1003.1g does not actually define this clearly |
1618 | at all. POSIX 1003.1g doesn't define a lot of things | 1618 | at all. POSIX 1003.1g doesn't define a lot of things |
1619 | clearly however! | 1619 | clearly however! |
1620 | 1620 | ||
1621 | */ | 1621 | */ |
1622 | if (UNIXCB(skb).fp) | 1622 | if (UNIXCB(skb).fp) |
1623 | siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp); | 1623 | siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp); |
@@ -1637,7 +1637,7 @@ out: | |||
1637 | /* | 1637 | /* |
1638 | * Sleep until data has arrive. But check for races.. | 1638 | * Sleep until data has arrive. But check for races.. |
1639 | */ | 1639 | */ |
1640 | 1640 | ||
1641 | static long unix_stream_data_wait(struct sock * sk, long timeo) | 1641 | static long unix_stream_data_wait(struct sock * sk, long timeo) |
1642 | { | 1642 | { |
1643 | DEFINE_WAIT(wait); | 1643 | DEFINE_WAIT(wait); |
@@ -1721,7 +1721,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1721 | /* | 1721 | /* |
1722 | * POSIX 1003.1g mandates this order. | 1722 | * POSIX 1003.1g mandates this order. |
1723 | */ | 1723 | */ |
1724 | 1724 | ||
1725 | if ((err = sock_error(sk)) != 0) | 1725 | if ((err = sock_error(sk)) != 0) |
1726 | break; | 1726 | break; |
1727 | if (sk->sk_shutdown & RCV_SHUTDOWN) | 1727 | if (sk->sk_shutdown & RCV_SHUTDOWN) |
@@ -1937,7 +1937,7 @@ static struct sock *unix_seq_idx(int *iter, loff_t pos) | |||
1937 | struct sock *s; | 1937 | struct sock *s; |
1938 | 1938 | ||
1939 | for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) { | 1939 | for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) { |
1940 | if (off == pos) | 1940 | if (off == pos) |
1941 | return s; | 1941 | return s; |
1942 | ++off; | 1942 | ++off; |
1943 | } | 1943 | } |
@@ -1955,7 +1955,7 @@ static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1955 | { | 1955 | { |
1956 | ++*pos; | 1956 | ++*pos; |
1957 | 1957 | ||
1958 | if (v == (void *)1) | 1958 | if (v == (void *)1) |
1959 | return first_unix_socket(seq->private); | 1959 | return first_unix_socket(seq->private); |
1960 | return next_unix_socket(seq->private, v); | 1960 | return next_unix_socket(seq->private, v); |
1961 | } | 1961 | } |
@@ -1967,7 +1967,7 @@ static void unix_seq_stop(struct seq_file *seq, void *v) | |||
1967 | 1967 | ||
1968 | static int unix_seq_show(struct seq_file *seq, void *v) | 1968 | static int unix_seq_show(struct seq_file *seq, void *v) |
1969 | { | 1969 | { |
1970 | 1970 | ||
1971 | if (v == (void *)1) | 1971 | if (v == (void *)1) |
1972 | seq_puts(seq, "Num RefCount Protocol Flags Type St " | 1972 | seq_puts(seq, "Num RefCount Protocol Flags Type St " |
1973 | "Inode Path\n"); | 1973 | "Inode Path\n"); |
@@ -2064,8 +2064,8 @@ static int __init af_unix_init(void) | |||
2064 | BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)); | 2064 | BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)); |
2065 | 2065 | ||
2066 | rc = proto_register(&unix_proto, 1); | 2066 | rc = proto_register(&unix_proto, 1); |
2067 | if (rc != 0) { | 2067 | if (rc != 0) { |
2068 | printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n", | 2068 | printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n", |
2069 | __FUNCTION__); | 2069 | __FUNCTION__); |
2070 | goto out; | 2070 | goto out; |
2071 | } | 2071 | } |
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index f14ad6635fcc..f8bcf5d114d9 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
@@ -63,7 +63,7 @@ | |||
63 | * Damn. Added missing check for ->dead in listen queues scanning. | 63 | * Damn. Added missing check for ->dead in listen queues scanning. |
64 | * | 64 | * |
65 | */ | 65 | */ |
66 | 66 | ||
67 | #include <linux/kernel.h> | 67 | #include <linux/kernel.h> |
68 | #include <linux/sched.h> | 68 | #include <linux/sched.h> |
69 | #include <linux/string.h> | 69 | #include <linux/string.h> |
@@ -118,7 +118,7 @@ static struct sock *unix_get_socket(struct file *filp) | |||
118 | * Keep the number of times in flight count for the file | 118 | * Keep the number of times in flight count for the file |
119 | * descriptor if it is for an AF_UNIX socket. | 119 | * descriptor if it is for an AF_UNIX socket. |
120 | */ | 120 | */ |
121 | 121 | ||
122 | void unix_inflight(struct file *fp) | 122 | void unix_inflight(struct file *fp) |
123 | { | 123 | { |
124 | struct sock *s = unix_get_socket(fp); | 124 | struct sock *s = unix_get_socket(fp); |
@@ -190,7 +190,7 @@ void unix_gc(void) | |||
190 | unix_sk(s)->gc_tree = GC_ORPHAN; | 190 | unix_sk(s)->gc_tree = GC_ORPHAN; |
191 | } | 191 | } |
192 | /* | 192 | /* |
193 | * Everything is now marked | 193 | * Everything is now marked |
194 | */ | 194 | */ |
195 | 195 | ||
196 | /* Invariant to be maintained: | 196 | /* Invariant to be maintained: |
@@ -227,7 +227,7 @@ void unix_gc(void) | |||
227 | } | 227 | } |
228 | 228 | ||
229 | /* | 229 | /* |
230 | * Mark phase | 230 | * Mark phase |
231 | */ | 231 | */ |
232 | 232 | ||
233 | while (!empty_stack()) | 233 | while (!empty_stack()) |
@@ -237,11 +237,11 @@ void unix_gc(void) | |||
237 | 237 | ||
238 | spin_lock(&x->sk_receive_queue.lock); | 238 | spin_lock(&x->sk_receive_queue.lock); |
239 | skb = skb_peek(&x->sk_receive_queue); | 239 | skb = skb_peek(&x->sk_receive_queue); |
240 | 240 | ||
241 | /* | 241 | /* |
242 | * Loop through all but first born | 242 | * Loop through all but first born |
243 | */ | 243 | */ |
244 | 244 | ||
245 | while (skb && skb != (struct sk_buff *)&x->sk_receive_queue) { | 245 | while (skb && skb != (struct sk_buff *)&x->sk_receive_queue) { |
246 | /* | 246 | /* |
247 | * Do we have file descriptors ? | 247 | * Do we have file descriptors ? |