diff options
Diffstat (limited to 'net/dccp/proto.c')
| -rw-r--r-- | net/dccp/proto.c | 24 | 
1 files changed, 11 insertions, 13 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 152975d942d..de2c1e71930 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -184,7 +184,6 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)  	dp->dccps_rate_last	= jiffies;  	dp->dccps_role		= DCCP_ROLE_UNDEFINED;  	dp->dccps_service	= DCCP_SERVICE_CODE_IS_ABSENT; -	dp->dccps_l_ack_ratio	= dp->dccps_r_ack_ratio = 1;  	dp->dccps_tx_qlen	= sysctl_dccp_tx_qlen;  	dccp_init_xmit_timers(sk); @@ -337,7 +336,7 @@ unsigned int dccp_poll(struct file *file, struct socket *sock,  			mask |= POLLIN | POLLRDNORM;  		if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { -			if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) { +			if (sk_stream_is_writeable(sk)) {  				mask |= POLLOUT | POLLWRNORM;  			} else {  /* send SIGIO later */  				set_bit(SOCK_ASYNC_NOSPACE, @@ -348,7 +347,7 @@ unsigned int dccp_poll(struct file *file, struct socket *sock,  				 * wspace test but before the flags are set,  				 * IO signal will be lost.  				 */ -				if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) +				if (sk_stream_is_writeable(sk))  					mask |= POLLOUT | POLLWRNORM;  			}  		} @@ -849,7 +848,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,  		default:  			dccp_pr_debug("packet_type=%s\n",  				      dccp_packet_name(dh->dccph_type)); -			sk_eat_skb(sk, skb, 0); +			sk_eat_skb(sk, skb, false);  		}  verify_sock_status:  		if (sock_flag(sk, SOCK_DONE)) { @@ -906,7 +905,7 @@ verify_sock_status:  			len = skb->len;  	found_fin_ok:  		if (!(flags & MSG_PEEK)) -			sk_eat_skb(sk, skb, 0); +			sk_eat_skb(sk, skb, false);  		break;  	} while (1);  out: @@ -1085,14 +1084,15 @@ EXPORT_SYMBOL_GPL(dccp_shutdown);  static inline int dccp_mib_init(void)  { -	return snmp_mib_init((void __percpu **)dccp_statistics, -			     sizeof(struct dccp_mib), -			     __alignof__(struct dccp_mib)); +	dccp_statistics = alloc_percpu(struct dccp_mib); +	if (!dccp_statistics) +		return -ENOMEM; +	return 0;  }  static inline void dccp_mib_exit(void)  { -	snmp_mib_free((void __percpu **)dccp_statistics); +	free_percpu(dccp_statistics);  }  static int thash_entries; @@ -1100,7 +1100,7 @@ module_param(thash_entries, int, 0444);  MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");  #ifdef CONFIG_IP_DCCP_DEBUG -int dccp_debug; +bool dccp_debug;  module_param(dccp_debug, bool, 0644);  MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); @@ -1159,10 +1159,8 @@ static int __init dccp_init(void)  		goto out_free_bind_bucket_cachep;  	} -	for (i = 0; i <= dccp_hashinfo.ehash_mask; i++) { +	for (i = 0; i <= dccp_hashinfo.ehash_mask; i++)  		INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].chain, i); -		INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].twchain, i); -	}  	if (inet_ehash_locks_alloc(&dccp_hashinfo))  			goto out_free_dccp_ehash;  | 
