aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 16:35:17 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 16:35:17 -0500
commit21b4e736922f546e0f1aa7b9d6c442f309a2444a (patch)
treee1be8645297f8ebe87445251743ebcc52081a20d /net/sunrpc
parent34161db6b14d984fb9b06c735b7b42f8803f6851 (diff)
parent68380b581383c028830f79ec2670f4a193854aa6 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ into merge_linus
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/rpc_pipe.c6
-rw-r--r--net/sunrpc/sched.c4
-rw-r--r--net/sunrpc/svcauth.c3
-rw-r--r--net/sunrpc/svcsock.c32
-rw-r--r--net/sunrpc/xprtsock.c31
5 files changed, 70 insertions, 6 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 49dba5febbbd..19703aa9659e 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -33,7 +33,7 @@ static int rpc_mount_count;
33static struct file_system_type rpc_pipe_fs_type; 33static struct file_system_type rpc_pipe_fs_type;
34 34
35 35
36static kmem_cache_t *rpc_inode_cachep __read_mostly; 36static struct kmem_cache *rpc_inode_cachep __read_mostly;
37 37
38#define RPC_UPCALL_TIMEOUT (30*HZ) 38#define RPC_UPCALL_TIMEOUT (30*HZ)
39 39
@@ -143,7 +143,7 @@ static struct inode *
143rpc_alloc_inode(struct super_block *sb) 143rpc_alloc_inode(struct super_block *sb)
144{ 144{
145 struct rpc_inode *rpci; 145 struct rpc_inode *rpci;
146 rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, SLAB_KERNEL); 146 rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
147 if (!rpci) 147 if (!rpci)
148 return NULL; 148 return NULL;
149 return &rpci->vfs_inode; 149 return &rpci->vfs_inode;
@@ -824,7 +824,7 @@ static struct file_system_type rpc_pipe_fs_type = {
824}; 824};
825 825
826static void 826static void
827init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) 827init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
828{ 828{
829 struct rpc_inode *rpci = (struct rpc_inode *) foo; 829 struct rpc_inode *rpci = (struct rpc_inode *) foo;
830 830
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 18a33d327012..79bc4cdf5d48 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -34,8 +34,8 @@ static int rpc_task_id;
34#define RPC_BUFFER_MAXSIZE (2048) 34#define RPC_BUFFER_MAXSIZE (2048)
35#define RPC_BUFFER_POOLSIZE (8) 35#define RPC_BUFFER_POOLSIZE (8)
36#define RPC_TASK_POOLSIZE (8) 36#define RPC_TASK_POOLSIZE (8)
37static kmem_cache_t *rpc_task_slabp __read_mostly; 37static struct kmem_cache *rpc_task_slabp __read_mostly;
38static kmem_cache_t *rpc_buffer_slabp __read_mostly; 38static struct kmem_cache *rpc_buffer_slabp __read_mostly;
39static mempool_t *rpc_task_mempool __read_mostly; 39static mempool_t *rpc_task_mempool __read_mostly;
40static mempool_t *rpc_buffer_mempool __read_mostly; 40static mempool_t *rpc_buffer_mempool __read_mostly;
41 41
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index ee9bb1522d5e..c7bb5f7f21a5 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -119,7 +119,8 @@ EXPORT_SYMBOL(svc_auth_unregister);
119#define DN_HASHMASK (DN_HASHMAX-1) 119#define DN_HASHMASK (DN_HASHMAX-1)
120 120
121static struct hlist_head auth_domain_table[DN_HASHMAX]; 121static struct hlist_head auth_domain_table[DN_HASHMAX];
122static spinlock_t auth_domain_lock = SPIN_LOCK_UNLOCKED; 122static spinlock_t auth_domain_lock =
123 __SPIN_LOCK_UNLOCKED(auth_domain_lock);
123 124
124void auth_domain_put(struct auth_domain *dom) 125void auth_domain_put(struct auth_domain *dom)
125{ 126{
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 64ca1f61dd94..99f54fb6d669 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -32,6 +32,7 @@
32#include <linux/netdevice.h> 32#include <linux/netdevice.h>
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <linux/file.h> 34#include <linux/file.h>
35#include <linux/freezer.h>
35#include <net/sock.h> 36#include <net/sock.h>
36#include <net/checksum.h> 37#include <net/checksum.h>
37#include <net/ip.h> 38#include <net/ip.h>
@@ -84,6 +85,35 @@ static struct cache_deferred_req *svc_defer(struct cache_req *req);
84 */ 85 */
85static int svc_conn_age_period = 6*60; 86static int svc_conn_age_period = 6*60;
86 87
88#ifdef CONFIG_DEBUG_LOCK_ALLOC
89static struct lock_class_key svc_key[2];
90static struct lock_class_key svc_slock_key[2];
91
92static inline void svc_reclassify_socket(struct socket *sock)
93{
94 struct sock *sk = sock->sk;
95 BUG_ON(sk->sk_lock.owner != NULL);
96 switch (sk->sk_family) {
97 case AF_INET:
98 sock_lock_init_class_and_name(sk, "slock-AF_INET-NFSD",
99 &svc_slock_key[0], "sk_lock-AF_INET-NFSD", &svc_key[0]);
100 break;
101
102 case AF_INET6:
103 sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFSD",
104 &svc_slock_key[1], "sk_lock-AF_INET6-NFSD", &svc_key[1]);
105 break;
106
107 default:
108 BUG();
109 }
110}
111#else
112static inline void svc_reclassify_socket(struct socket *sock)
113{
114}
115#endif
116
87/* 117/*
88 * Queue up an idle server thread. Must have pool->sp_lock held. 118 * Queue up an idle server thread. Must have pool->sp_lock held.
89 * Note: this is really a stack rather than a queue, so that we only 119 * Note: this is really a stack rather than a queue, so that we only
@@ -1556,6 +1586,8 @@ svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin)
1556 if ((error = sock_create_kern(PF_INET, type, protocol, &sock)) < 0) 1586 if ((error = sock_create_kern(PF_INET, type, protocol, &sock)) < 0)
1557 return error; 1587 return error;
1558 1588
1589 svc_reclassify_socket(sock);
1590
1559 if (type == SOCK_STREAM) 1591 if (type == SOCK_STREAM)
1560 sock->sk->sk_reuse = 1; /* allow address reuse */ 1592 sock->sk->sk_reuse = 1; /* allow address reuse */
1561 error = kernel_bind(sock, (struct sockaddr *) sin, 1593 error = kernel_bind(sock, (struct sockaddr *) sin,
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 3bb232eb5d90..49cabffd7fdb 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1173,6 +1173,35 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock)
1173 return err; 1173 return err;
1174} 1174}
1175 1175
1176#ifdef CONFIG_DEBUG_LOCK_ALLOC
1177static struct lock_class_key xs_key[2];
1178static struct lock_class_key xs_slock_key[2];
1179
1180static inline void xs_reclassify_socket(struct socket *sock)
1181{
1182 struct sock *sk = sock->sk;
1183 BUG_ON(sk->sk_lock.owner != NULL);
1184 switch (sk->sk_family) {
1185 case AF_INET:
1186 sock_lock_init_class_and_name(sk, "slock-AF_INET-NFS",
1187 &xs_slock_key[0], "sk_lock-AF_INET-NFS", &xs_key[0]);
1188 break;
1189
1190 case AF_INET6:
1191 sock_lock_init_class_and_name(sk, "slock-AF_INET6-NFS",
1192 &xs_slock_key[1], "sk_lock-AF_INET6-NFS", &xs_key[1]);
1193 break;
1194
1195 default:
1196 BUG();
1197 }
1198}
1199#else
1200static inline void xs_reclassify_socket(struct socket *sock)
1201{
1202}
1203#endif
1204
1176/** 1205/**
1177 * xs_udp_connect_worker - set up a UDP socket 1206 * xs_udp_connect_worker - set up a UDP socket
1178 * @work: RPC transport to connect 1207 * @work: RPC transport to connect
@@ -1197,6 +1226,7 @@ static void xs_udp_connect_worker(struct work_struct *work)
1197 dprintk("RPC: can't create UDP transport socket (%d).\n", -err); 1226 dprintk("RPC: can't create UDP transport socket (%d).\n", -err);
1198 goto out; 1227 goto out;
1199 } 1228 }
1229 xs_reclassify_socket(sock);
1200 1230
1201 if (xprt->resvport && xs_bindresvport(transport, sock) < 0) { 1231 if (xprt->resvport && xs_bindresvport(transport, sock) < 0) {
1202 sock_release(sock); 1232 sock_release(sock);
@@ -1282,6 +1312,7 @@ static void xs_tcp_connect_worker(struct work_struct *work)
1282 dprintk("RPC: can't create TCP transport socket (%d).\n", -err); 1312 dprintk("RPC: can't create TCP transport socket (%d).\n", -err);
1283 goto out; 1313 goto out;
1284 } 1314 }
1315 xs_reclassify_socket(sock);
1285 1316
1286 if (xprt->resvport && xs_bindresvport(transport, sock) < 0) { 1317 if (xprt->resvport && xs_bindresvport(transport, sock) < 0) {
1287 sock_release(sock); 1318 sock_release(sock);