Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdcde3d7 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[SOCK]: Drop inuse pcounter from struct proto (v2).



An uppercut - do not use the pcounter on struct proto.

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Acked-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60e7663d
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/lockdep.h>
#include <linux/lockdep.h>
#include <linux/netdevice.h>
#include <linux/netdevice.h>
#include <linux/pcounter.h>
#include <linux/skbuff.h>	/* struct sk_buff */
#include <linux/skbuff.h>	/* struct sk_buff */
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/security.h>
#include <linux/security.h>
@@ -563,7 +562,6 @@ struct proto {
	/* Keeping track of sockets in use */
	/* Keeping track of sockets in use */
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
	unsigned int		inuse_idx;
	unsigned int		inuse_idx;
	struct pcounter		inuse;
#endif
#endif


	/* Memory pressure */
	/* Memory pressure */
@@ -636,14 +634,10 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)




#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
# define DEFINE_PROTO_INUSE(NAME) DEFINE_PCOUNTER(NAME)
# define REF_PROTO_INUSE(NAME) PCOUNTER_MEMBER_INITIALIZER(NAME, .inuse)
/* Called with local bh disabled */
/* Called with local bh disabled */
extern void sock_prot_inuse_add(struct proto *prot, int inc);
extern void sock_prot_inuse_add(struct proto *prot, int inc);
extern int sock_prot_inuse_get(struct proto *proto);
extern int sock_prot_inuse_get(struct proto *proto);
#else
#else
# define DEFINE_PROTO_INUSE(NAME)
# define REF_PROTO_INUSE(NAME)
static void inline sock_prot_inuse_add(struct proto *prot, int inc)
static void inline sock_prot_inuse_add(struct proto *prot, int inc)
{
{
}
}
+0 −3
Original line number Original line Diff line number Diff line
@@ -915,8 +915,6 @@ static struct timewait_sock_ops dccp_timewait_sock_ops = {
	.twsk_obj_size	= sizeof(struct inet_timewait_sock),
	.twsk_obj_size	= sizeof(struct inet_timewait_sock),
};
};


DEFINE_PROTO_INUSE(dccp_v4)

static struct proto dccp_v4_prot = {
static struct proto dccp_v4_prot = {
	.name			= "DCCP",
	.name			= "DCCP",
	.owner			= THIS_MODULE,
	.owner			= THIS_MODULE,
@@ -946,7 +944,6 @@ static struct proto dccp_v4_prot = {
	.compat_setsockopt	= compat_dccp_setsockopt,
	.compat_setsockopt	= compat_dccp_setsockopt,
	.compat_getsockopt	= compat_dccp_getsockopt,
	.compat_getsockopt	= compat_dccp_getsockopt,
#endif
#endif
	REF_PROTO_INUSE(dccp_v4)
};
};


static struct net_protocol dccp_v4_protocol = {
static struct net_protocol dccp_v4_protocol = {
+0 −3
Original line number Original line Diff line number Diff line
@@ -1100,8 +1100,6 @@ static struct timewait_sock_ops dccp6_timewait_sock_ops = {
	.twsk_obj_size	= sizeof(struct dccp6_timewait_sock),
	.twsk_obj_size	= sizeof(struct dccp6_timewait_sock),
};
};


DEFINE_PROTO_INUSE(dccp_v6)

static struct proto dccp_v6_prot = {
static struct proto dccp_v6_prot = {
	.name		   = "DCCPv6",
	.name		   = "DCCPv6",
	.owner		   = THIS_MODULE,
	.owner		   = THIS_MODULE,
@@ -1131,7 +1129,6 @@ static struct proto dccp_v6_prot = {
	.compat_setsockopt = compat_dccp_setsockopt,
	.compat_setsockopt = compat_dccp_setsockopt,
	.compat_getsockopt = compat_dccp_getsockopt,
	.compat_getsockopt = compat_dccp_getsockopt,
#endif
#endif
	REF_PROTO_INUSE(dccp_v6)
};
};


static struct inet6_protocol dccp_v6_protocol = {
static struct inet6_protocol dccp_v6_protocol = {
+0 −3
Original line number Original line Diff line number Diff line
@@ -818,8 +818,6 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
	}
	}
}
}


DEFINE_PROTO_INUSE(raw)

struct proto raw_prot = {
struct proto raw_prot = {
	.name		   = "RAW",
	.name		   = "RAW",
	.owner		   = THIS_MODULE,
	.owner		   = THIS_MODULE,
@@ -842,7 +840,6 @@ struct proto raw_prot = {
	.compat_setsockopt = compat_raw_setsockopt,
	.compat_setsockopt = compat_raw_setsockopt,
	.compat_getsockopt = compat_raw_getsockopt,
	.compat_getsockopt = compat_raw_getsockopt,
#endif
#endif
	REF_PROTO_INUSE(raw)
};
};


#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
+0 −3
Original line number Original line Diff line number Diff line
@@ -2451,8 +2451,6 @@ void tcp4_proc_exit(void)
}
}
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_PROC_FS */


DEFINE_PROTO_INUSE(tcp)

struct proto tcp_prot = {
struct proto tcp_prot = {
	.name			= "TCP",
	.name			= "TCP",
	.owner			= THIS_MODULE,
	.owner			= THIS_MODULE,
@@ -2488,7 +2486,6 @@ struct proto tcp_prot = {
	.compat_setsockopt	= compat_tcp_setsockopt,
	.compat_setsockopt	= compat_tcp_setsockopt,
	.compat_getsockopt	= compat_tcp_getsockopt,
	.compat_getsockopt	= compat_tcp_getsockopt,
#endif
#endif
	REF_PROTO_INUSE(tcp)
};
};


void __init tcp_v4_init(void)
void __init tcp_v4_init(void)
Loading