[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMDZJNWK5dBt_40DcbCOadtZpFYsGaZjudkJcq0rS_Z-wjNgFA@mail.gmail.com>
Date: Fri, 17 Nov 2017 06:06:31 +0800
From: Tonghao Zhang <xiangxia.m.yue@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Martin Zhang <zhangjunweimartin@...ichuxing.com>,
Tonghao Zhang <zhangtonghao@...ichuxing.com>
Subject: Re: [PATCH v3 2/2] sock: Move the socket inuse to namespace.
On Fri, Nov 17, 2017 at 4:20 AM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Wed, Nov 15, 2017 at 7:36 AM, Tonghao Zhang <xiangxia.m.yue@...il.com> wrote:
>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index b899d8669388..f01ed0b41bde 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -145,6 +145,10 @@
>> static DEFINE_MUTEX(proto_list_mutex);
>> static LIST_HEAD(proto_list);
>>
>> +#ifdef CONFIG_PROC_FS
>> +static void sock_inuse_add(struct net *net, int val);
>> +#endif
>> +
>> /**
>> * sk_ns_capable - General socket capability test
>> * @sk: Socket to use a capability on or through
>> @@ -1536,6 +1540,7 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
>> if (likely(sk->sk_net_refcnt))
>> get_net(net);
>> sock_net_set(sk, net);
>> + sock_inuse_add(net, 1);
>
> You don't need to define a nop for sock_inuse_add() in
> !CONFIG_PROC_FS case?
Yes, we should. But we cant config the CONFIG_PROC_FS in 'make menuconfig'
Then !CONFIG_PROC_FS is a rare event. so I dont check it there, such
as other counter sock_prot_inuse_add.
A patch will be sent for fixing !CONFIG_PROC_FS. and v4 will be sent
too. Thanks a lot, cong.
Powered by blists - more mailing lists