提交 d392e497 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[UNIX]: Move the sysctl_unix_max_dgram_qlen

This will make all the sub-namespaces always use the
default value (10) and leave the tuning via sysctl
to the init namespace only.

Per-namespace tuning is coming.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Acked-by: NEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 97577e38
...@@ -38,6 +38,9 @@ struct net { ...@@ -38,6 +38,9 @@ struct net {
/* List of all packet sockets. */ /* List of all packet sockets. */
rwlock_t packet_sklist_lock; rwlock_t packet_sklist_lock;
struct hlist_head packet_sklist; struct hlist_head packet_sklist;
/* unix sockets */
int sysctl_unix_max_dgram_qlen;
}; };
#ifdef CONFIG_NET #ifdef CONFIG_NET
......
...@@ -117,8 +117,6 @@ ...@@ -117,8 +117,6 @@
#include <net/checksum.h> #include <net/checksum.h>
#include <linux/security.h> #include <linux/security.h>
int sysctl_unix_max_dgram_qlen __read_mostly = 10;
static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
static DEFINE_SPINLOCK(unix_table_lock); static DEFINE_SPINLOCK(unix_table_lock);
static atomic_t unix_nr_socks = ATOMIC_INIT(0); static atomic_t unix_nr_socks = ATOMIC_INIT(0);
...@@ -594,7 +592,7 @@ static struct sock * unix_create1(struct net *net, struct socket *sock) ...@@ -594,7 +592,7 @@ static struct sock * unix_create1(struct net *net, struct socket *sock)
&af_unix_sk_receive_queue_lock_key); &af_unix_sk_receive_queue_lock_key);
sk->sk_write_space = unix_write_space; sk->sk_write_space = unix_write_space;
sk->sk_max_ack_backlog = sysctl_unix_max_dgram_qlen; sk->sk_max_ack_backlog = net->sysctl_unix_max_dgram_qlen;
sk->sk_destruct = unix_sock_destructor; sk->sk_destruct = unix_sock_destructor;
u = unix_sk(sk); u = unix_sk(sk);
u->dentry = NULL; u->dentry = NULL;
...@@ -2140,6 +2138,8 @@ static int unix_net_init(struct net *net) ...@@ -2140,6 +2138,8 @@ static int unix_net_init(struct net *net)
{ {
int error = -ENOMEM; int error = -ENOMEM;
net->sysctl_unix_max_dgram_qlen = 10;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
if (!proc_net_fops_create(net, "unix", 0, &unix_seq_fops)) if (!proc_net_fops_create(net, "unix", 0, &unix_seq_fops))
goto out; goto out;
......
...@@ -18,7 +18,7 @@ static ctl_table unix_table[] = { ...@@ -18,7 +18,7 @@ static ctl_table unix_table[] = {
{ {
.ctl_name = NET_UNIX_MAX_DGRAM_QLEN, .ctl_name = NET_UNIX_MAX_DGRAM_QLEN,
.procname = "max_dgram_qlen", .procname = "max_dgram_qlen",
.data = &sysctl_unix_max_dgram_qlen, .data = &init_net.sysctl_unix_max_dgram_qlen,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = &proc_dointvec
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册