diff options
Diffstat (limited to 'net/unix/garbage.c')
| -rw-r--r-- | net/unix/garbage.c | 26 | 
1 files changed, 12 insertions, 14 deletions
| diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 406b6433e46..ebdff3d877a 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -92,7 +92,7 @@ static LIST_HEAD(gc_inflight_list);  static LIST_HEAD(gc_candidates);  static DEFINE_SPINLOCK(unix_gc_lock); -atomic_t unix_tot_inflight = ATOMIC_INIT(0); +unsigned int unix_tot_inflight;  static struct sock *unix_get_socket(struct file *filp) @@ -133,7 +133,7 @@ void unix_inflight(struct file *fp)  		} else {  			BUG_ON(list_empty(&u->link));  		} -		atomic_inc(&unix_tot_inflight); +		unix_tot_inflight++;  		spin_unlock(&unix_gc_lock);  	}  } @@ -147,7 +147,7 @@ void unix_notinflight(struct file *fp)  		BUG_ON(list_empty(&u->link));  		if (atomic_dec_and_test(&u->inflight))  			list_del_init(&u->link); -		atomic_dec(&unix_tot_inflight); +		unix_tot_inflight--;  		spin_unlock(&unix_gc_lock);  	}  } @@ -161,7 +161,7 @@ static inline struct sk_buff *sock_queue_head(struct sock *sk)  	for (skb = sock_queue_head(sk)->next, next = skb->next; \  	     skb != sock_queue_head(sk); skb = next, next = skb->next) -static void scan_inflight(struct sock *x, void (*func)(struct sock *), +static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),  			  struct sk_buff_head *hitlist)  {  	struct sk_buff *skb; @@ -185,9 +185,9 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *),  				 *	if it indeed does so  				 */  				struct sock *sk = unix_get_socket(*fp++); -				if(sk) { +				if (sk) {  					hit = true; -					func(sk); +					func(unix_sk(sk));  				}  			}  			if (hit && hitlist != NULL) { @@ -199,7 +199,7 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *),  	spin_unlock(&x->sk_receive_queue.lock);  } -static void scan_children(struct sock *x, void (*func)(struct sock *), +static void scan_children(struct sock *x, void (*func)(struct unix_sock *),  			  struct sk_buff_head *hitlist)  {  	if (x->sk_state != TCP_LISTEN) @@ -235,20 +235,18 @@ static void scan_children(struct sock *x, void (*func)(struct sock *),  	}  } -static void dec_inflight(struct sock *sk) +static void dec_inflight(struct unix_sock *usk)  { -	atomic_dec(&unix_sk(sk)->inflight); +	atomic_dec(&usk->inflight);  } -static void inc_inflight(struct sock *sk) +static void inc_inflight(struct unix_sock *usk)  { -	atomic_inc(&unix_sk(sk)->inflight); +	atomic_inc(&usk->inflight);  } -static void inc_inflight_move_tail(struct sock *sk) +static void inc_inflight_move_tail(struct unix_sock *u)  { -	struct unix_sock *u = unix_sk(sk); -  	atomic_inc(&u->inflight);  	/*  	 * If this is still a candidate, move it to the end of the | 
