.. | .. |
---|
14 | 14 | void unix_gc(void); |
---|
15 | 15 | void wait_for_unix_gc(void); |
---|
16 | 16 | struct sock *unix_get_socket(struct file *filp); |
---|
17 | | -struct sock *unix_peer_get(struct sock *); |
---|
| 17 | +struct sock *unix_peer_get(struct sock *sk); |
---|
18 | 18 | |
---|
19 | 19 | #define UNIX_HASH_SIZE 256 |
---|
20 | 20 | #define UNIX_HASH_BITS 8 |
---|
.. | .. |
---|
27 | 27 | refcount_t refcnt; |
---|
28 | 28 | int len; |
---|
29 | 29 | unsigned int hash; |
---|
30 | | - struct sockaddr_un name[0]; |
---|
| 30 | + struct sockaddr_un name[]; |
---|
31 | 31 | }; |
---|
32 | 32 | |
---|
33 | 33 | struct unix_skb_parms { |
---|
.. | .. |
---|
41 | 41 | u32 consumed; |
---|
42 | 42 | } __randomize_layout; |
---|
43 | 43 | |
---|
44 | | -#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) |
---|
| 44 | +struct scm_stat { |
---|
| 45 | + atomic_t nr_fds; |
---|
| 46 | +}; |
---|
| 47 | + |
---|
| 48 | +#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) |
---|
45 | 49 | |
---|
46 | 50 | #define unix_state_lock(s) spin_lock(&unix_sk(s)->lock) |
---|
47 | 51 | #define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock) |
---|
.. | .. |
---|
53 | 57 | struct unix_sock { |
---|
54 | 58 | /* WARNING: sk has to be the first member */ |
---|
55 | 59 | struct sock sk; |
---|
56 | | - struct unix_address *addr; |
---|
| 60 | + struct unix_address *addr; |
---|
57 | 61 | struct path path; |
---|
58 | 62 | struct mutex iolock, bindlock; |
---|
59 | 63 | struct sock *peer; |
---|
.. | .. |
---|
64 | 68 | #define UNIX_GC_CANDIDATE 0 |
---|
65 | 69 | #define UNIX_GC_MAYBE_CYCLE 1 |
---|
66 | 70 | struct socket_wq peer_wq; |
---|
67 | | - wait_queue_entry_t peer_wake; |
---|
| 71 | + wait_queue_entry_t peer_wake; |
---|
| 72 | + struct scm_stat scm_stat; |
---|
68 | 73 | }; |
---|
69 | 74 | |
---|
70 | 75 | static inline struct unix_sock *unix_sk(const struct sock *sk) |
---|