]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
[UNIX]: Move the sysctl_unix_max_dgram_qlen
authorPavel Emelyanov <xemul@openvz.org>
Sat, 1 Dec 2007 12:44:15 +0000 (23:44 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:22 +0000 (14:55 -0800)
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: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/net_namespace.h
net/unix/af_unix.c
net/unix/sysctl_net_unix.c

index 235214c4c231e420b4c05e8027f05e07f3c4911c..b0cf07519b81eb4f1ac71d674fc56d817b51ec3c 100644 (file)
@@ -38,6 +38,9 @@ struct net {
        /* List of all packet sockets. */
        rwlock_t                packet_sklist_lock;
        struct hlist_head       packet_sklist;
+
+       /* unix sockets */
+       int                     sysctl_unix_max_dgram_qlen;
 };
 
 #ifdef CONFIG_NET
index a0aa6d3c2c084ad713979da5dd3778a233d63a64..73620d61762b40f0dae89fcf738593f0a5a0b2de 100644 (file)
 #include <net/checksum.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 DEFINE_SPINLOCK(unix_table_lock);
 static atomic_t unix_nr_socks = ATOMIC_INIT(0);
@@ -594,7 +592,7 @@ static struct sock * unix_create1(struct net *net, struct socket *sock)
                                &af_unix_sk_receive_queue_lock_key);
 
        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;
        u         = unix_sk(sk);
        u->dentry = NULL;
@@ -2140,6 +2138,8 @@ static int unix_net_init(struct net *net)
 {
        int error = -ENOMEM;
 
+       net->sysctl_unix_max_dgram_qlen = 10;
+
 #ifdef CONFIG_PROC_FS
        if (!proc_net_fops_create(net, "unix", 0, &unix_seq_fops))
                goto out;
index b2e0407e1b7b7685386c208f3180d6a17a6724c9..c46cec04d23f070f5b3f76611792764920b58187 100644 (file)
@@ -18,7 +18,7 @@ static ctl_table unix_table[] = {
        {
                .ctl_name       = NET_UNIX_MAX_DGRAM_QLEN,
                .procname       = "max_dgram_qlen",
-               .data           = &sysctl_unix_max_dgram_qlen,
+               .data           = &init_net.sysctl_unix_max_dgram_qlen,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec