[NET] UNIX: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
c430728526
commit
ac7bfa62f3
@@ -195,7 +195,7 @@ static inline void unix_release_addr(struct unix_address *addr)
|
|||||||
* - if started by not zero, should be NULL terminated (FS object)
|
* - if started by not zero, should be NULL terminated (FS object)
|
||||||
* - if started by zero, it is abstract name.
|
* - if started by zero, it is abstract name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp)
|
static int unix_mkname(struct sockaddr_un * sunaddr, int len, unsigned *hashp)
|
||||||
{
|
{
|
||||||
if (len <= sizeof(short) || len > sizeof(*sunaddr))
|
if (len <= sizeof(short) || len > sizeof(*sunaddr))
|
||||||
@@ -432,7 +432,7 @@ static int unix_release_sock (struct sock *sk, int embrion)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (atomic_read(&unix_tot_inflight))
|
if (atomic_read(&unix_tot_inflight))
|
||||||
unix_gc(); /* Garbage collect fds */
|
unix_gc(); /* Garbage collect fds */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -698,7 +698,7 @@ static struct sock *unix_find_other(struct sockaddr_un *sunname, int len,
|
|||||||
struct sock *u;
|
struct sock *u;
|
||||||
struct nameidata nd;
|
struct nameidata nd;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (sunname->sun_path[0]) {
|
if (sunname->sun_path[0]) {
|
||||||
err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);
|
err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);
|
||||||
if (err)
|
if (err)
|
||||||
@@ -915,7 +915,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
|
|||||||
unix_peer(sk)=other;
|
unix_peer(sk)=other;
|
||||||
unix_state_wunlock(sk);
|
unix_state_wunlock(sk);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
unix_state_wunlock(sk);
|
unix_state_wunlock(sk);
|
||||||
@@ -1021,7 +1021,7 @@ restart:
|
|||||||
goto out;
|
goto out;
|
||||||
sock_put(other);
|
sock_put(other);
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Latch our state.
|
/* Latch our state.
|
||||||
|
|
||||||
@@ -1415,7 +1415,7 @@ out:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
||||||
struct msghdr *msg, size_t len)
|
struct msghdr *msg, size_t len)
|
||||||
{
|
{
|
||||||
@@ -1467,11 +1467,11 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
|||||||
|
|
||||||
if (size > SKB_MAX_ALLOC)
|
if (size > SKB_MAX_ALLOC)
|
||||||
size = SKB_MAX_ALLOC;
|
size = SKB_MAX_ALLOC;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Grab a buffer
|
* Grab a buffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
skb=sock_alloc_send_skb(sk,size,msg->msg_flags&MSG_DONTWAIT, &err);
|
skb=sock_alloc_send_skb(sk,size,msg->msg_flags&MSG_DONTWAIT, &err);
|
||||||
|
|
||||||
if (skb==NULL)
|
if (skb==NULL)
|
||||||
@@ -1530,7 +1530,7 @@ static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
|
|
||||||
err = sock_error(sk);
|
err = sock_error(sk);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@@ -1543,7 +1543,7 @@ static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
|||||||
|
|
||||||
return unix_dgram_sendmsg(kiocb, sock, msg, len);
|
return unix_dgram_sendmsg(kiocb, sock, msg, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
|
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
|
||||||
{
|
{
|
||||||
struct unix_sock *u = unix_sk(sk);
|
struct unix_sock *u = unix_sk(sk);
|
||||||
@@ -1605,7 +1605,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
if (UNIXCB(skb).fp)
|
if (UNIXCB(skb).fp)
|
||||||
unix_detach_fds(siocb->scm, skb);
|
unix_detach_fds(siocb->scm, skb);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* It is questionable: on PEEK we could:
|
/* It is questionable: on PEEK we could:
|
||||||
- do not return fds - good, but too simple 8)
|
- do not return fds - good, but too simple 8)
|
||||||
@@ -1613,11 +1613,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
apparently wrong)
|
apparently wrong)
|
||||||
- clone fds (I chose it for now, it is the most universal
|
- clone fds (I chose it for now, it is the most universal
|
||||||
solution)
|
solution)
|
||||||
|
|
||||||
POSIX 1003.1g does not actually define this clearly
|
POSIX 1003.1g does not actually define this clearly
|
||||||
at all. POSIX 1003.1g doesn't define a lot of things
|
at all. POSIX 1003.1g doesn't define a lot of things
|
||||||
clearly however!
|
clearly however!
|
||||||
|
|
||||||
*/
|
*/
|
||||||
if (UNIXCB(skb).fp)
|
if (UNIXCB(skb).fp)
|
||||||
siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
|
siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
|
||||||
@@ -1637,7 +1637,7 @@ out:
|
|||||||
/*
|
/*
|
||||||
* Sleep until data has arrive. But check for races..
|
* Sleep until data has arrive. But check for races..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static long unix_stream_data_wait(struct sock * sk, long timeo)
|
static long unix_stream_data_wait(struct sock * sk, long timeo)
|
||||||
{
|
{
|
||||||
DEFINE_WAIT(wait);
|
DEFINE_WAIT(wait);
|
||||||
@@ -1721,7 +1721,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
/*
|
/*
|
||||||
* POSIX 1003.1g mandates this order.
|
* POSIX 1003.1g mandates this order.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((err = sock_error(sk)) != 0)
|
if ((err = sock_error(sk)) != 0)
|
||||||
break;
|
break;
|
||||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||||
@@ -1937,7 +1937,7 @@ static struct sock *unix_seq_idx(int *iter, loff_t pos)
|
|||||||
struct sock *s;
|
struct sock *s;
|
||||||
|
|
||||||
for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) {
|
for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) {
|
||||||
if (off == pos)
|
if (off == pos)
|
||||||
return s;
|
return s;
|
||||||
++off;
|
++off;
|
||||||
}
|
}
|
||||||
@@ -1955,7 +1955,7 @@ static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
|
|||||||
{
|
{
|
||||||
++*pos;
|
++*pos;
|
||||||
|
|
||||||
if (v == (void *)1)
|
if (v == (void *)1)
|
||||||
return first_unix_socket(seq->private);
|
return first_unix_socket(seq->private);
|
||||||
return next_unix_socket(seq->private, v);
|
return next_unix_socket(seq->private, v);
|
||||||
}
|
}
|
||||||
@@ -1967,7 +1967,7 @@ static void unix_seq_stop(struct seq_file *seq, void *v)
|
|||||||
|
|
||||||
static int unix_seq_show(struct seq_file *seq, void *v)
|
static int unix_seq_show(struct seq_file *seq, void *v)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (v == (void *)1)
|
if (v == (void *)1)
|
||||||
seq_puts(seq, "Num RefCount Protocol Flags Type St "
|
seq_puts(seq, "Num RefCount Protocol Flags Type St "
|
||||||
"Inode Path\n");
|
"Inode Path\n");
|
||||||
@@ -2064,8 +2064,8 @@ static int __init af_unix_init(void)
|
|||||||
BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb));
|
BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb));
|
||||||
|
|
||||||
rc = proto_register(&unix_proto, 1);
|
rc = proto_register(&unix_proto, 1);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
|
printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@@ -63,7 +63,7 @@
|
|||||||
* Damn. Added missing check for ->dead in listen queues scanning.
|
* Damn. Added missing check for ->dead in listen queues scanning.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
@@ -118,7 +118,7 @@ static struct sock *unix_get_socket(struct file *filp)
|
|||||||
* Keep the number of times in flight count for the file
|
* Keep the number of times in flight count for the file
|
||||||
* descriptor if it is for an AF_UNIX socket.
|
* descriptor if it is for an AF_UNIX socket.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void unix_inflight(struct file *fp)
|
void unix_inflight(struct file *fp)
|
||||||
{
|
{
|
||||||
struct sock *s = unix_get_socket(fp);
|
struct sock *s = unix_get_socket(fp);
|
||||||
@@ -190,7 +190,7 @@ void unix_gc(void)
|
|||||||
unix_sk(s)->gc_tree = GC_ORPHAN;
|
unix_sk(s)->gc_tree = GC_ORPHAN;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Everything is now marked
|
* Everything is now marked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Invariant to be maintained:
|
/* Invariant to be maintained:
|
||||||
@@ -227,7 +227,7 @@ void unix_gc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mark phase
|
* Mark phase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (!empty_stack())
|
while (!empty_stack())
|
||||||
@@ -237,11 +237,11 @@ void unix_gc(void)
|
|||||||
|
|
||||||
spin_lock(&x->sk_receive_queue.lock);
|
spin_lock(&x->sk_receive_queue.lock);
|
||||||
skb = skb_peek(&x->sk_receive_queue);
|
skb = skb_peek(&x->sk_receive_queue);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop through all but first born
|
* Loop through all but first born
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (skb && skb != (struct sk_buff *)&x->sk_receive_queue) {
|
while (skb && skb != (struct sk_buff *)&x->sk_receive_queue) {
|
||||||
/*
|
/*
|
||||||
* Do we have file descriptors ?
|
* Do we have file descriptors ?
|
||||||
|
Reference in New Issue
Block a user