Subject: Re: [PATCH] Phonet: sockets list through proc_fs

From: Eric Dumazet <[email-masked]>
Date: Mon, 20 Jul 2009 11:05:05 +0200

Rémi Denis-Courmont a écrit :
> From: Rémi Denis-Courmont <[email-masked]>
> 

> +static int pn_sock_seq_show(struct seq_file *seq, void *v)
> +{
> +	int len;
> +
> +	if (v == SEQ_START_TOKEN)
> +		seq_printf(seq, "%s%n", "pt  loc  rem rs st tx_queue rx_queue "
> +			"  uid inode ref pointer drops", &len);
> +	else {
> +		struct sock *sk = v;
> +		struct pn_sock *pn = pn_sk(sk);
> +
> +		seq_printf(seq, "%2d %04X:%04X:%02X %02X %08X:%08X %5d %lu "
> +			"%d %p %d%n",
> +			sk->sk_protocol, pn->sobject, 0, pn->resource,
> +			sk->sk_state,
> +			atomic_read(&sk->sk_wmem_alloc),
> +			atomic_read(&sk->sk_rmem_alloc),

Please use sk_wmem_alloc_get(sk) and  sk_rmem_alloc_get(sk)

> +			sock_i_uid(sk), sock_i_ino(sk),
> +			atomic_read(&sk->sk_refcnt), sk,
> +			atomic_read(&sk->sk_drops), &len);
> +	}
> +	seq_printf(seq, "%*s\n", 127 - len, "");
> +	return 0;
> +}