]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[NET]: move struct proto_ops to const
authorEric Dumazet <dada1@cosmosbay.com>
Thu, 22 Dec 2005 20:49:22 +0000 (12:49 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 3 Jan 2006 21:11:15 +0000 (13:11 -0800)
I noticed that some of 'struct proto_ops' used in the kernel may share
a cache line used by locks or other heavily modified data. (default
linker alignement is 32 bytes, and L1_CACHE_LINE is 64 or 128 at
least)

This patch makes sure a 'struct proto_ops' can be declared as const,
so that all cpus can share all parts of it without false sharing.

This is not mandatory : a driver can still use a read/write structure
if it needs to (and eventually a __read_mostly)

I made a global stubstitute to change all existing occurences to make
them const.

This should reduce the possibility of false sharing on SMP, and
speedup some socket system calls.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
33 files changed:
include/linux/net.h
include/net/inet_common.h
include/net/ipv6.h
include/net/protocol.h
net/appletalk/ddp.c
net/atm/pvc.c
net/atm/svc.c
net/ax25/af_ax25.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c
net/dccp/proto.c
net/decnet/af_decnet.c
net/econet/af_econet.c
net/ipv4/af_inet.c
net/ipv6/af_inet6.c
net/ipx/af_ipx.c
net/irda/af_irda.c
net/key/af_key.c
net/llc/af_llc.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/packet/af_packet.c
net/sctp/ipv6.c
net/sctp/protocol.c
net/sunrpc/svcsock.c
net/unix/af_unix.c
net/wanrouter/af_wanpipe.c
net/x25/af_x25.c

index d6a41e6577f61a3b2729247af897532ab3b44ea3..28195a2d8ff0a50501a5ab180ef6bf3b252cbb28 100644 (file)
@@ -107,7 +107,7 @@ enum sock_type {
 struct socket {
        socket_state            state;
        unsigned long           flags;
-       struct proto_ops        *ops;
+       const struct proto_ops  *ops;
        struct fasync_struct    *fasync_list;
        struct file             *file;
        struct sock             *sk;
@@ -260,7 +260,7 @@ SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct ms
 SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
              (file, sock, vma)) \
              \
-static struct proto_ops name##_ops = {                 \
+static const struct proto_ops name##_ops = {                   \
        .family         = fam,                          \
        .owner          = THIS_MODULE,                  \
        .release        = __lock_##name##_release,      \
index f943306ce5ff3104092f604ed4d23c5c93de9855..227adcbdfec801e313f9e4c49a029a8f4347be90 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _INET_COMMON_H
 #define _INET_COMMON_H
 
-extern struct proto_ops                inet_stream_ops;
-extern struct proto_ops                inet_dgram_ops;
+extern const struct proto_ops          inet_stream_ops;
+extern const struct proto_ops          inet_dgram_ops;
 
 /*
  *     INET4 prototypes used by INET6
index e3d5d7bc88372b72179e4dede1ce2654f434f6b6..11a725662c3628779f5c40bbc1215dc27458c38f 100644 (file)
@@ -538,8 +538,8 @@ extern int sysctl_ip6frag_low_thresh;
 extern int sysctl_ip6frag_time;
 extern int sysctl_ip6frag_secret_interval;
 
-extern struct proto_ops inet6_stream_ops;
-extern struct proto_ops inet6_dgram_ops;
+extern const struct proto_ops inet6_stream_ops;
+extern const struct proto_ops inet6_dgram_ops;
 
 extern int ip6_mc_source(int add, int omode, struct sock *sk,
                         struct group_source_req *pgsr);
index a29cb29647d085e7b77dd9016fcaba6c0d744f00..63f7db99c2a67c526dffd96a090621f5542e6765 100644 (file)
@@ -65,7 +65,7 @@ struct inet_protosw {
        int              protocol; /* This is the L4 protocol number.  */
 
        struct proto     *prot;
-       struct proto_ops *ops;
+       const struct proto_ops *ops;
   
        int              capability; /* Which (if any) capability do
                                      * we need to use this socket
index 7982656b9c830d7ea1c819d427240ca5a797a210..296f186802ffd007209ce4572e8bed2a4c30296f 100644 (file)
@@ -63,7 +63,7 @@
 #include <linux/atalk.h>
 
 struct datalink_proto *ddp_dl, *aarp_dl;
-static struct proto_ops atalk_dgram_ops;
+static const struct proto_ops atalk_dgram_ops;
 
 /**************************************************************************\
 *                                                                          *
@@ -1841,7 +1841,7 @@ static struct net_proto_family atalk_family_ops = {
        .owner          = THIS_MODULE,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = {
        .family         = PF_APPLETALK,
        .owner          = THIS_MODULE,
        .release        = atalk_release,
index 2684a92da22bdbc3cdc98d4680c27c70fe315943..f2c541774dcd77e14a7dc8cc47c53a36b3b6f3bb 100644 (file)
@@ -102,7 +102,7 @@ static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr,
 }
 
 
-static struct proto_ops pvc_proto_ops = {
+static const struct proto_ops pvc_proto_ops = {
        .family =       PF_ATMPVC,
        .owner =        THIS_MODULE,
 
index d7b266136bf64168d0ce7ac8cc5796801fc11f13..3a180cfd7b48ee37116f9b78a1dc98081a9528d5 100644 (file)
@@ -613,7 +613,7 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return error;
 }
 
-static struct proto_ops svc_proto_ops = {
+static const struct proto_ops svc_proto_ops = {
        .family =       PF_ATMSVC,
        .owner =        THIS_MODULE,
 
index 1b683f302657d376f438b8f9ea68805bdd14118c..8b5d10aaba059b698485a51feafa840c36061905 100644 (file)
@@ -54,7 +54,7 @@
 HLIST_HEAD(ax25_list);
 DEFINE_SPINLOCK(ax25_list_lock);
 
-static struct proto_ops ax25_proto_ops;
+static const struct proto_ops ax25_proto_ops;
 
 static void ax25_free_sock(struct sock *sk)
 {
@@ -1944,7 +1944,7 @@ static struct net_proto_family ax25_family_ops = {
        .owner  =       THIS_MODULE,
 };
 
-static struct proto_ops ax25_proto_ops = {
+static const struct proto_ops ax25_proto_ops = {
        .family         = PF_AX25,
        .owner          = THIS_MODULE,
        .release        = ax25_release,
index 9778c6acd53bb5785482794f33fb903be719c215..ccbaf69afc5b0d000b1c389bb11ebdc33657bb9f 100644 (file)
@@ -146,7 +146,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return 0;
 }
 
-static struct proto_ops bnep_sock_ops = {
+static const struct proto_ops bnep_sock_ops = {
        .family     = PF_BLUETOOTH,
        .owner      = THIS_MODULE,
        .release    = bnep_sock_release,
index beb045bf5714bd54e4b9d60fef75498959a31b2c..5e22343b6090a5aabf6ad593c601ff44d89c4711 100644 (file)
@@ -137,7 +137,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return -EINVAL;
 }
 
-static struct proto_ops cmtp_sock_ops = {
+static const struct proto_ops cmtp_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = cmtp_sock_release,
index 1d6d0a15c099a8c4e8f38a63ed78925c0c6f827e..84e6c93a044ad50e934fe8aaa008b4e48354d0fc 100644 (file)
@@ -575,7 +575,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char
        return 0;
 }
 
-static struct proto_ops hci_sock_ops = {
+static const struct proto_ops hci_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = hci_sock_release,
index f8986f8814319a242beb06788af564e7f70f3b34..8f8dd931b2948b1746c7163f97084c307442155a 100644 (file)
@@ -143,7 +143,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
        return -EINVAL;
 }
 
-static struct proto_ops hidp_sock_ops = {
+static const struct proto_ops hidp_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = hidp_sock_release,
index 95f33cc7a24eacebcaa4b57c90740bfea52e9fd7..7f0781e4326f0cb944d6f43bc121eb9f3b695a49 100644 (file)
@@ -57,7 +57,7 @@
 
 #define VERSION "2.8"
 
-static struct proto_ops l2cap_sock_ops;
+static const struct proto_ops l2cap_sock_ops;
 
 static struct bt_sock_list l2cap_sk_list = {
        .lock = RW_LOCK_UNLOCKED
@@ -2161,7 +2161,7 @@ static ssize_t l2cap_sysfs_show(struct class *dev, char *buf)
 
 static CLASS_ATTR(l2cap, S_IRUGO, l2cap_sysfs_show, NULL);
 
-static struct proto_ops l2cap_sock_ops = {
+static const struct proto_ops l2cap_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = l2cap_sock_release,
index 6c34261b232e4cd2d9d0b254e7ae8701a3dfd021..757d2dd3b02f1bb710e49e982ca3c55a790cbae7 100644 (file)
@@ -58,7 +58,7 @@
 #define BT_DBG(D...)
 #endif
 
-static struct proto_ops rfcomm_sock_ops;
+static const struct proto_ops rfcomm_sock_ops;
 
 static struct bt_sock_list rfcomm_sk_list = {
        .lock = RW_LOCK_UNLOCKED
@@ -907,7 +907,7 @@ static ssize_t rfcomm_sock_sysfs_show(struct class *dev, char *buf)
 
 static CLASS_ATTR(rfcomm, S_IRUGO, rfcomm_sock_sysfs_show, NULL);
 
-static struct proto_ops rfcomm_sock_ops = {
+static const struct proto_ops rfcomm_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = rfcomm_sock_release,
index 648181430699d81e86717e361b9ca5844323acb7..6b61323ce23cad772371657cf18833027f56d0f9 100644 (file)
@@ -56,7 +56,7 @@
 
 #define VERSION "0.5"
 
-static struct proto_ops sco_sock_ops;
+static const struct proto_ops sco_sock_ops;
 
 static struct bt_sock_list sco_sk_list = {
        .lock = RW_LOCK_UNLOCKED
@@ -914,7 +914,7 @@ static ssize_t sco_sysfs_show(struct class *dev, char *buf)
 
 static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL);
 
-static struct proto_ops sco_sock_ops = {
+static const struct proto_ops sco_sock_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .release        = sco_sock_release,
index 40a4c6899051324dd2d08268dd10f1fb88550456..e4e629ed9bf72e78c2c82edd343f232e3a0900bd 100644 (file)
@@ -680,7 +680,7 @@ void dccp_shutdown(struct sock *sk, int how)
 
 EXPORT_SYMBOL_GPL(dccp_shutdown);
 
-static struct proto_ops inet_dccp_ops = {
+static const struct proto_ops inet_dccp_ops = {
        .family         = PF_INET,
        .owner          = THIS_MODULE,
        .release        = inet_release,
index d402e9020c684126bf9a1f418e7e7c9549a6e9dd..65e3baed02517ac7b5d90a693a8985cc0fa52bc3 100644 (file)
@@ -149,7 +149,7 @@ static void dn_keepalive(struct sock *sk);
 #define DN_SK_HASH_MASK (DN_SK_HASH_SIZE - 1)
 
 
-static struct proto_ops dn_proto_ops;
+static const struct proto_ops dn_proto_ops;
 static DEFINE_RWLOCK(dn_hash_lock);
 static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE];
 static struct hlist_head dn_wild_sk;
@@ -2342,7 +2342,7 @@ static struct net_proto_family    dn_family_ops = {
        .owner  =       THIS_MODULE,
 };
 
-static struct proto_ops dn_proto_ops = {
+static const struct proto_ops dn_proto_ops = {
        .family =       AF_DECnet,
        .owner =        THIS_MODULE,
        .release =      dn_release,
index 34fdac51df965d45d22b850da9aa379e17cfeac0..ff58f49c8b4aee0e61be4726e5bfcf7ce8b54a69 100644 (file)
@@ -45,7 +45,7 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
-static struct proto_ops econet_ops;
+static const struct proto_ops econet_ops;
 static struct hlist_head econet_sklist;
 static DEFINE_RWLOCK(econet_lock);
 
@@ -698,7 +698,7 @@ static struct net_proto_family econet_family_ops = {
        .owner  =       THIS_MODULE,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
        .family =       PF_ECONET,
        .owner =        THIS_MODULE,
        .release =      econet_release,
index 617e858beff1b7fd3dc3775b62dba111e04363f3..4ed8a814c6cbc73214897bae499ab0949651d4d8 100644 (file)
@@ -785,7 +785,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return err;
 }
 
-struct proto_ops inet_stream_ops = {
+const struct proto_ops inet_stream_ops = {
        .family =       PF_INET,
        .owner =        THIS_MODULE,
        .release =      inet_release,
@@ -806,7 +806,7 @@ struct proto_ops inet_stream_ops = {
        .sendpage =     tcp_sendpage
 };
 
-struct proto_ops inet_dgram_ops = {
+const struct proto_ops inet_dgram_ops = {
        .family =       PF_INET,
        .owner =        THIS_MODULE,
        .release =      inet_release,
@@ -831,7 +831,7 @@ struct proto_ops inet_dgram_ops = {
  * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without
  * udp_poll
  */
-static struct proto_ops inet_sockraw_ops = {
+static const struct proto_ops inet_sockraw_ops = {
        .family =       PF_INET,
        .owner =        THIS_MODULE,
        .release =      inet_release,
index 70a510ff31eec1822fdab834ef04cf4d650efd71..7c9f19269f21a1a1684a4d1f17455564dd7f75d8 100644 (file)
@@ -462,7 +462,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return(0);
 }
 
-struct proto_ops inet6_stream_ops = {
+const struct proto_ops inet6_stream_ops = {
        .family =       PF_INET6,
        .owner =        THIS_MODULE,
        .release =      inet6_release,
@@ -483,7 +483,7 @@ struct proto_ops inet6_stream_ops = {
        .sendpage =     tcp_sendpage
 };
 
-struct proto_ops inet6_dgram_ops = {
+const struct proto_ops inet6_dgram_ops = {
        .family =       PF_INET6,
        .owner =        THIS_MODULE,
        .release =      inet6_release,
@@ -511,7 +511,7 @@ static struct net_proto_family inet6_family_ops = {
 };
 
 /* Same as inet6_dgram_ops, sans udp_poll.  */
-static struct proto_ops inet6_sockraw_ops = {
+static const struct proto_ops inet6_sockraw_ops = {
        .family =       PF_INET6,
        .owner =        THIS_MODULE,
        .release =      inet6_release,
index 34b3bb86840912da024646f070170f9c933c650e..6c464c11bb09a72364415678cf129a045331861d 100644 (file)
@@ -75,7 +75,7 @@ static struct datalink_proto *pEII_datalink;
 static struct datalink_proto *p8023_datalink;
 static struct datalink_proto *pSNAP_datalink;
 
-static struct proto_ops ipx_dgram_ops;
+static const struct proto_ops ipx_dgram_ops;
 
 LIST_HEAD(ipx_interfaces);
 DEFINE_SPINLOCK(ipx_interfaces_lock);
@@ -1901,7 +1901,7 @@ static struct net_proto_family ipx_family_ops = {
        .owner          = THIS_MODULE,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {
        .family         = PF_IPX,
        .owner          = THIS_MODULE,
        .release        = ipx_release,
index f121f7de203261e0467c95adab5bb6fc64a33b8e..e57683d424f760462293a904c826dbd4649177f5 100644 (file)
 
 static int irda_create(struct socket *sock, int protocol);
 
-static struct proto_ops irda_stream_ops;
-static struct proto_ops irda_seqpacket_ops;
-static struct proto_ops irda_dgram_ops;
+static const struct proto_ops irda_stream_ops;
+static const struct proto_ops irda_seqpacket_ops;
+static const struct proto_ops irda_dgram_ops;
 
 #ifdef CONFIG_IRDA_ULTRA
-static struct proto_ops irda_ultra_ops;
+static const struct proto_ops irda_ultra_ops;
 #define ULTRA_MAX_DATA 382
 #endif /* CONFIG_IRDA_ULTRA */
 
@@ -2464,7 +2464,7 @@ static struct net_proto_family irda_family_ops = {
        .owner  = THIS_MODULE,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
        .family =       PF_IRDA,
        .owner =        THIS_MODULE,
        .release =      irda_release,
@@ -2485,7 +2485,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = {
        .family =       PF_IRDA,
        .owner =        THIS_MODULE,
        .release =      irda_release,
@@ -2506,7 +2506,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_seqpacket_ops) = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = {
        .family =       PF_IRDA,
        .owner =        THIS_MODULE,
        .release =      irda_release,
@@ -2528,7 +2528,7 @@ static struct proto_ops SOCKOPS_WRAPPED(irda_dgram_ops) = {
 };
 
 #ifdef CONFIG_IRDA_ULTRA
-static struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(irda_ultra_ops) = {
        .family =       PF_IRDA,
        .owner =        THIS_MODULE,
        .release =      irda_release,
index d32f7791f1e4344b0d099618756d2f77d4261a97..52efd04cbedbb64ea409e1d81f5d608d8e52caa4 100644 (file)
@@ -113,7 +113,7 @@ static __inline__ void pfkey_unlock_table(void)
 }
 
 
-static struct proto_ops pfkey_ops;
+static const struct proto_ops pfkey_ops;
 
 static void pfkey_insert(struct sock *sk)
 {
@@ -3127,7 +3127,7 @@ out:
        return err;
 }
 
-static struct proto_ops pfkey_ops = {
+static const struct proto_ops pfkey_ops = {
        .family         =       PF_KEY,
        .owner          =       THIS_MODULE,
        /* Operations that make no sense on pfkey sockets. */
index b6d3df5c911c93d3008b177c7f1b7adb91441516..9cf65f9d8902621e13b0fc876d3301c86bbb6cfb 100644 (file)
@@ -36,7 +36,7 @@
 static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START;
 static u16 llc_ui_sap_link_no_max[256];
 static struct sockaddr_llc llc_ui_addrnull;
-static struct proto_ops llc_ui_ops;
+static const struct proto_ops llc_ui_ops;
 
 static int llc_ui_wait_for_conn(struct sock *sk, long timeout);
 static int llc_ui_wait_for_disc(struct sock *sk, long timeout);
@@ -1098,7 +1098,7 @@ static struct net_proto_family llc_ui_family_ops = {
        .owner  = THIS_MODULE,
 };
 
-static struct proto_ops llc_ui_ops = {
+static const struct proto_ops llc_ui_ops = {
        .family      = PF_LLC,
        .owner       = THIS_MODULE,
        .release     = llc_ui_release,
index 96020d7087e8f131c3ebab3d6d0355cc595809fd..7849cac14d3a4ab24d8ab03abd8f959fde19a8f8 100644 (file)
@@ -293,7 +293,7 @@ static inline int nl_pid_hash_dilute(struct nl_pid_hash *hash, int len)
        return 0;
 }
 
-static struct proto_ops netlink_ops;
+static const struct proto_ops netlink_ops;
 
 static int netlink_insert(struct sock *sk, u32 pid)
 {
@@ -1656,7 +1656,7 @@ int netlink_unregister_notifier(struct notifier_block *nb)
        return notifier_chain_unregister(&netlink_chain, nb);
 }
                 
-static struct proto_ops netlink_ops = {
+static const struct proto_ops netlink_ops = {
        .family =       PF_NETLINK,
        .owner =        THIS_MODULE,
        .release =      netlink_release,
index e5d82d711cae2ea36e1e36e652fdeebd0b5db591..05b653c0597160d83d62d530381ec980da557eb4 100644 (file)
@@ -63,7 +63,7 @@ static unsigned short circuit = 0x101;
 static HLIST_HEAD(nr_list);
 static DEFINE_SPINLOCK(nr_list_lock);
 
-static struct proto_ops nr_proto_ops;
+static const struct proto_ops nr_proto_ops;
 
 /*
  *     Socket removal during an interrupt is now safe.
@@ -1337,7 +1337,7 @@ static struct net_proto_family nr_family_ops = {
        .owner          =       THIS_MODULE,
 };
 
-static struct proto_ops nr_proto_ops = {
+static const struct proto_ops nr_proto_ops = {
        .family         =       PF_NETROM,
        .owner          =       THIS_MODULE,
        .release        =       nr_release,
index 3e2462760413ee5871cbd3061f57be83df6c1aa1..deda6fdb1e534890d2af062951b37299900e401e 100644 (file)
@@ -251,10 +251,10 @@ static void packet_sock_destruct(struct sock *sk)
 }
 
 
-static struct proto_ops packet_ops;
+static const struct proto_ops packet_ops;
 
 #ifdef CONFIG_SOCK_PACKET
-static struct proto_ops packet_ops_spkt;
+static const struct proto_ops packet_ops_spkt;
 
 static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,  struct packet_type *pt, struct net_device *orig_dev)
 {
@@ -1784,7 +1784,7 @@ out:
 
 
 #ifdef CONFIG_SOCK_PACKET
-static struct proto_ops packet_ops_spkt = {
+static const struct proto_ops packet_ops_spkt = {
        .family =       PF_PACKET,
        .owner =        THIS_MODULE,
        .release =      packet_release,
@@ -1806,7 +1806,7 @@ static struct proto_ops packet_ops_spkt = {
 };
 #endif
 
-static struct proto_ops packet_ops = {
+static const struct proto_ops packet_ops = {
        .family =       PF_PACKET,
        .owner =        THIS_MODULE,
        .release =      packet_release,
index fa3be2b8fb5ffcaa88ac19e5919f7703461f90ef..15c05165c905173b49a3e109f109a96cc5d607a9 100644 (file)
@@ -866,7 +866,7 @@ static int sctp_inet6_supported_addrs(const struct sctp_sock *opt,
        return 2;
 }
 
-static struct proto_ops inet6_seqpacket_ops = {
+static const struct proto_ops inet6_seqpacket_ops = {
        .family     = PF_INET6,
        .owner      = THIS_MODULE,
        .release    = inet6_release,
index f775d78aa59d3402ea467331c301e66acfdfd26e..d1b0747a5b9daa863df196cb3a3136fe0e1db276 100644 (file)
@@ -829,7 +829,7 @@ static struct notifier_block sctp_inetaddr_notifier = {
 };
 
 /* Socket operations.  */
-static struct proto_ops inet_seqpacket_ops = {
+static const struct proto_ops inet_seqpacket_ops = {
        .family      = PF_INET,
        .owner       = THIS_MODULE,
        .release     = inet_release,       /* Needs to be wrapped... */
index c6a51911e71e082a232f73444b3c36deb42a0d08..d68eba481291fd1bb1467c0c526e7f3e0e445b49 100644 (file)
@@ -758,7 +758,7 @@ svc_tcp_accept(struct svc_sock *svsk)
        struct svc_serv *serv = svsk->sk_server;
        struct socket   *sock = svsk->sk_sock;
        struct socket   *newsock;
-       struct proto_ops *ops;
+       const struct proto_ops *ops;
        struct svc_sock *newsvsk;
        int             err, slen;
 
index 04e850e04e3d4146c490abd389e7c299a1079e9c..7d3fe6aebcdb24774d71f439cffe17d4460b5143 100644 (file)
@@ -473,7 +473,7 @@ static int unix_dgram_connect(struct socket *, struct sockaddr *,
 static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,
                                  struct msghdr *, size_t);
 
-static struct proto_ops unix_stream_ops = {
+static const struct proto_ops unix_stream_ops = {
        .family =       PF_UNIX,
        .owner =        THIS_MODULE,
        .release =      unix_release,
@@ -494,7 +494,7 @@ static struct proto_ops unix_stream_ops = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct proto_ops unix_dgram_ops = {
+static const struct proto_ops unix_dgram_ops = {
        .family =       PF_UNIX,
        .owner =        THIS_MODULE,
        .release =      unix_release,
@@ -515,7 +515,7 @@ static struct proto_ops unix_dgram_ops = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct proto_ops unix_seqpacket_ops = {
+static const struct proto_ops unix_seqpacket_ops = {
        .family =       PF_UNIX,
        .owner =        THIS_MODULE,
        .release =      unix_release,
index 59fec59b2132df1ab43e782d2a469a84bf373dd0..67948bf22dc46f44bb19cec6ffb81653178354f5 100644 (file)
@@ -181,7 +181,7 @@ struct wanpipe_opt
 #endif
 
 static int sk_count;
-extern struct proto_ops wanpipe_ops;
+extern const struct proto_ops wanpipe_ops;
 static unsigned long find_free_critical;
 
 static void wanpipe_unlink_driver(struct sock *sk);
@@ -2546,7 +2546,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr
        return 0;
 }
 
-struct proto_ops wanpipe_ops = {
+const struct proto_ops wanpipe_ops = {
        .family =       PF_WANPIPE,
        .owner =        THIS_MODULE,
        .release =      wanpipe_release,
index 020d73cc8414916f6a0bf65b2fbe675ec5759ead..ca8b3b0b920d58a145fa174936673858dfffe9df 100644 (file)
@@ -64,7 +64,7 @@ int sysctl_x25_ack_holdback_timeout    = X25_DEFAULT_T2;
 HLIST_HEAD(x25_list);
 DEFINE_RWLOCK(x25_list_lock);
 
-static struct proto_ops x25_proto_ops;
+static const struct proto_ops x25_proto_ops;
 
 static struct x25_address null_x25_address = {"               "};
 
@@ -1391,7 +1391,7 @@ static struct net_proto_family x25_family_ops = {
        .owner  =       THIS_MODULE,
 };
 
-static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
+static const struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
        .family =       AF_X25,
        .owner =        THIS_MODULE,
        .release =      x25_release,