diff options
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/auth.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/cache.h | 8 | ||||
-rw-r--r-- | include/linux/sunrpc/clnt.h | 40 | ||||
-rw-r--r-- | include/linux/sunrpc/debug.h | 26 | ||||
-rw-r--r-- | include/linux/sunrpc/metrics.h | 6 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 46 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 24 | ||||
-rw-r--r-- | include/linux/sunrpc/stats.h | 22 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 13 | ||||
-rw-r--r-- | include/linux/sunrpc/svc_xprt.h | 3 | ||||
-rw-r--r-- | include/linux/sunrpc/svcauth.h | 3 | ||||
-rw-r--r-- | include/linux/sunrpc/svcauth_gss.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/svcsock.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 11 | ||||
-rw-r--r-- | include/linux/sunrpc/xprtsock.h | 12 |
16 files changed, 148 insertions, 74 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 7874a8a56638..492a36d72829 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -99,6 +99,8 @@ struct rpc_authops { | |||
99 | 99 | ||
100 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); | 100 | struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); |
101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); | 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); |
102 | int (*pipes_create)(struct rpc_auth *); | ||
103 | void (*pipes_destroy)(struct rpc_auth *); | ||
102 | }; | 104 | }; |
103 | 105 | ||
104 | struct rpc_credops { | 106 | struct rpc_credops { |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index f7f3ce340c08..969c0a671dbf 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | 35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); |
36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); |
39 | int bc_send(struct rpc_rqst *req); | 39 | int bc_send(struct rpc_rqst *req); |
40 | 40 | ||
41 | /* | 41 | /* |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 57531f8e5956..f5fd6160dbca 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -117,6 +117,7 @@ struct cache_detail { | |||
117 | struct cache_detail_procfs procfs; | 117 | struct cache_detail_procfs procfs; |
118 | struct cache_detail_pipefs pipefs; | 118 | struct cache_detail_pipefs pipefs; |
119 | } u; | 119 | } u; |
120 | struct net *net; | ||
120 | }; | 121 | }; |
121 | 122 | ||
122 | 123 | ||
@@ -197,11 +198,14 @@ extern void cache_flush(void); | |||
197 | extern void cache_purge(struct cache_detail *detail); | 198 | extern void cache_purge(struct cache_detail *detail); |
198 | #define NEVER (0x7FFFFFFF) | 199 | #define NEVER (0x7FFFFFFF) |
199 | extern void __init cache_initialize(void); | 200 | extern void __init cache_initialize(void); |
200 | extern int cache_register(struct cache_detail *cd); | ||
201 | extern int cache_register_net(struct cache_detail *cd, struct net *net); | 201 | extern int cache_register_net(struct cache_detail *cd, struct net *net); |
202 | extern void cache_unregister(struct cache_detail *cd); | ||
203 | extern void cache_unregister_net(struct cache_detail *cd, struct net *net); | 202 | extern void cache_unregister_net(struct cache_detail *cd, struct net *net); |
204 | 203 | ||
204 | extern struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct net *net); | ||
205 | extern void cache_destroy_net(struct cache_detail *cd, struct net *net); | ||
206 | |||
207 | extern void sunrpc_init_cache_detail(struct cache_detail *cd); | ||
208 | extern void sunrpc_destroy_cache_detail(struct cache_detail *cd); | ||
205 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, | 209 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, |
206 | umode_t, struct cache_detail *); | 210 | umode_t, struct cache_detail *); |
207 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); | 211 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 2c5993a17c33..523547ecfee2 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -35,14 +35,13 @@ struct rpc_clnt { | |||
35 | struct list_head cl_clients; /* Global list of clients */ | 35 | struct list_head cl_clients; /* Global list of clients */ |
36 | struct list_head cl_tasks; /* List of tasks */ | 36 | struct list_head cl_tasks; /* List of tasks */ |
37 | spinlock_t cl_lock; /* spinlock */ | 37 | spinlock_t cl_lock; /* spinlock */ |
38 | struct rpc_xprt * cl_xprt; /* transport */ | 38 | struct rpc_xprt __rcu * cl_xprt; /* transport */ |
39 | struct rpc_procinfo * cl_procinfo; /* procedure info */ | 39 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
40 | u32 cl_prog, /* RPC program number */ | 40 | u32 cl_prog, /* RPC program number */ |
41 | cl_vers, /* RPC version number */ | 41 | cl_vers, /* RPC version number */ |
42 | cl_maxproc; /* max procedure number */ | 42 | cl_maxproc; /* max procedure number */ |
43 | 43 | ||
44 | char * cl_server; /* server machine name */ | 44 | const char * cl_protname; /* protocol name */ |
45 | char * cl_protname; /* protocol name */ | ||
46 | struct rpc_auth * cl_auth; /* authenticator */ | 45 | struct rpc_auth * cl_auth; /* authenticator */ |
47 | struct rpc_stat * cl_stats; /* per-program statistics */ | 46 | struct rpc_stat * cl_stats; /* per-program statistics */ |
48 | struct rpc_iostats * cl_metrics; /* per-client statistics */ | 47 | struct rpc_iostats * cl_metrics; /* per-client statistics */ |
@@ -57,12 +56,11 @@ struct rpc_clnt { | |||
57 | 56 | ||
58 | int cl_nodelen; /* nodename length */ | 57 | int cl_nodelen; /* nodename length */ |
59 | char cl_nodename[UNX_MAXNODENAME]; | 58 | char cl_nodename[UNX_MAXNODENAME]; |
60 | struct path cl_path; | 59 | struct dentry * cl_dentry; |
61 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 60 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
62 | struct rpc_rtt cl_rtt_default; | 61 | struct rpc_rtt cl_rtt_default; |
63 | struct rpc_timeout cl_timeout_default; | 62 | struct rpc_timeout cl_timeout_default; |
64 | struct rpc_program * cl_program; | 63 | const struct rpc_program *cl_program; |
65 | char cl_inline_name[32]; | ||
66 | char *cl_principal; /* target to authenticate to */ | 64 | char *cl_principal; /* target to authenticate to */ |
67 | }; | 65 | }; |
68 | 66 | ||
@@ -71,12 +69,12 @@ struct rpc_clnt { | |||
71 | */ | 69 | */ |
72 | #define RPC_MAXVERSION 4 | 70 | #define RPC_MAXVERSION 4 |
73 | struct rpc_program { | 71 | struct rpc_program { |
74 | char * name; /* protocol name */ | 72 | const char * name; /* protocol name */ |
75 | u32 number; /* program number */ | 73 | u32 number; /* program number */ |
76 | unsigned int nrvers; /* number of versions */ | 74 | unsigned int nrvers; /* number of versions */ |
77 | struct rpc_version ** version; /* version array */ | 75 | const struct rpc_version ** version; /* version array */ |
78 | struct rpc_stat * stats; /* statistics */ | 76 | struct rpc_stat * stats; /* statistics */ |
79 | char * pipe_dir_name; /* path to rpc_pipefs dir */ | 77 | const char * pipe_dir_name; /* path to rpc_pipefs dir */ |
80 | }; | 78 | }; |
81 | 79 | ||
82 | struct rpc_version { | 80 | struct rpc_version { |
@@ -97,7 +95,7 @@ struct rpc_procinfo { | |||
97 | unsigned int p_count; /* call count */ | 95 | unsigned int p_count; /* call count */ |
98 | unsigned int p_timer; /* Which RTT timer to use */ | 96 | unsigned int p_timer; /* Which RTT timer to use */ |
99 | u32 p_statidx; /* Which procedure to account */ | 97 | u32 p_statidx; /* Which procedure to account */ |
100 | char * p_name; /* name of procedure */ | 98 | const char * p_name; /* name of procedure */ |
101 | }; | 99 | }; |
102 | 100 | ||
103 | #ifdef __KERNEL__ | 101 | #ifdef __KERNEL__ |
@@ -109,8 +107,8 @@ struct rpc_create_args { | |||
109 | size_t addrsize; | 107 | size_t addrsize; |
110 | struct sockaddr *saddress; | 108 | struct sockaddr *saddress; |
111 | const struct rpc_timeout *timeout; | 109 | const struct rpc_timeout *timeout; |
112 | char *servername; | 110 | const char *servername; |
113 | struct rpc_program *program; | 111 | const struct rpc_program *program; |
114 | u32 prognumber; /* overrides program->number */ | 112 | u32 prognumber; /* overrides program->number */ |
115 | u32 version; | 113 | u32 version; |
116 | rpc_authflavor_t authflavor; | 114 | rpc_authflavor_t authflavor; |
@@ -129,17 +127,18 @@ struct rpc_create_args { | |||
129 | 127 | ||
130 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 128 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
131 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 129 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
132 | struct rpc_program *, u32); | 130 | const struct rpc_program *, u32); |
133 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); | 131 | void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); |
134 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 132 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
135 | void rpc_shutdown_client(struct rpc_clnt *); | 133 | void rpc_shutdown_client(struct rpc_clnt *); |
136 | void rpc_release_client(struct rpc_clnt *); | 134 | void rpc_release_client(struct rpc_clnt *); |
137 | void rpc_task_release_client(struct rpc_task *); | 135 | void rpc_task_release_client(struct rpc_task *); |
138 | 136 | ||
139 | int rpcb_create_local(void); | 137 | int rpcb_create_local(struct net *); |
140 | void rpcb_put_local(void); | 138 | void rpcb_put_local(struct net *); |
141 | int rpcb_register(u32, u32, int, unsigned short); | 139 | int rpcb_register(struct net *, u32, u32, int, unsigned short); |
142 | int rpcb_v4_register(const u32 program, const u32 version, | 140 | int rpcb_v4_register(struct net *net, const u32 program, |
141 | const u32 version, | ||
143 | const struct sockaddr *address, | 142 | const struct sockaddr *address, |
144 | const char *netid); | 143 | const char *netid); |
145 | void rpcb_getport_async(struct rpc_task *); | 144 | void rpcb_getport_async(struct rpc_task *); |
@@ -156,16 +155,19 @@ struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | |||
156 | int rpc_restart_call_prepare(struct rpc_task *); | 155 | int rpc_restart_call_prepare(struct rpc_task *); |
157 | int rpc_restart_call(struct rpc_task *); | 156 | int rpc_restart_call(struct rpc_task *); |
158 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 157 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
158 | int rpc_protocol(struct rpc_clnt *); | ||
159 | struct net * rpc_net_ns(struct rpc_clnt *); | ||
159 | size_t rpc_max_payload(struct rpc_clnt *); | 160 | size_t rpc_max_payload(struct rpc_clnt *); |
160 | void rpc_force_rebind(struct rpc_clnt *); | 161 | void rpc_force_rebind(struct rpc_clnt *); |
161 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 162 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
162 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 163 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
164 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); | ||
163 | 165 | ||
164 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | 166 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); |
165 | size_t rpc_pton(const char *, const size_t, | 167 | size_t rpc_pton(struct net *, const char *, const size_t, |
166 | struct sockaddr *, const size_t); | 168 | struct sockaddr *, const size_t); |
167 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | 169 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); |
168 | size_t rpc_uaddr2sockaddr(const char *, const size_t, | 170 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, |
169 | struct sockaddr *, const size_t); | 171 | struct sockaddr *, const size_t); |
170 | 172 | ||
171 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | 173 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index c2786f20016f..a76cc20d98ce 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -31,9 +31,12 @@ | |||
31 | /* | 31 | /* |
32 | * Enable RPC debugging/profiling. | 32 | * Enable RPC debugging/profiling. |
33 | */ | 33 | */ |
34 | #ifdef CONFIG_SYSCTL | 34 | #ifdef CONFIG_SUNRPC_DEBUG |
35 | #define RPC_DEBUG | 35 | #define RPC_DEBUG |
36 | #endif | 36 | #endif |
37 | #ifdef CONFIG_TRACEPOINTS | ||
38 | #define RPC_TRACEPOINTS | ||
39 | #endif | ||
37 | /* #define RPC_PROFILE */ | 40 | /* #define RPC_PROFILE */ |
38 | 41 | ||
39 | /* | 42 | /* |
@@ -47,15 +50,32 @@ extern unsigned int nlm_debug; | |||
47 | #endif | 50 | #endif |
48 | 51 | ||
49 | #define dprintk(args...) dfprintk(FACILITY, ## args) | 52 | #define dprintk(args...) dfprintk(FACILITY, ## args) |
53 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) | ||
50 | 54 | ||
51 | #undef ifdebug | 55 | #undef ifdebug |
52 | #ifdef RPC_DEBUG | 56 | #ifdef RPC_DEBUG |
53 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) | 57 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) |
54 | # define dfprintk(fac, args...) do { ifdebug(fac) printk(args); } while(0) | 58 | |
59 | # define dfprintk(fac, args...) \ | ||
60 | do { \ | ||
61 | ifdebug(fac) \ | ||
62 | printk(KERN_DEFAULT args); \ | ||
63 | } while (0) | ||
64 | |||
65 | # define dfprintk_rcu(fac, args...) \ | ||
66 | do { \ | ||
67 | ifdebug(fac) { \ | ||
68 | rcu_read_lock(); \ | ||
69 | printk(KERN_DEFAULT args); \ | ||
70 | rcu_read_unlock(); \ | ||
71 | } \ | ||
72 | } while (0) | ||
73 | |||
55 | # define RPC_IFDEBUG(x) x | 74 | # define RPC_IFDEBUG(x) x |
56 | #else | 75 | #else |
57 | # define ifdebug(fac) if (0) | 76 | # define ifdebug(fac) if (0) |
58 | # define dfprintk(fac, args...) do ; while (0) | 77 | # define dfprintk(fac, args...) do {} while (0) |
78 | # define dfprintk_rcu(fac, args...) do {} while (0) | ||
59 | # define RPC_IFDEBUG(x) | 79 | # define RPC_IFDEBUG(x) |
60 | #endif | 80 | #endif |
61 | 81 | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index b6edbc0ea83d..1565bbe86d51 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
@@ -74,14 +74,16 @@ struct rpc_clnt; | |||
74 | #ifdef CONFIG_PROC_FS | 74 | #ifdef CONFIG_PROC_FS |
75 | 75 | ||
76 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | 76 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); |
77 | void rpc_count_iostats(struct rpc_task *); | 77 | void rpc_count_iostats(const struct rpc_task *, |
78 | struct rpc_iostats *); | ||
78 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | 79 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); |
79 | void rpc_free_iostats(struct rpc_iostats *); | 80 | void rpc_free_iostats(struct rpc_iostats *); |
80 | 81 | ||
81 | #else /* CONFIG_PROC_FS */ | 82 | #else /* CONFIG_PROC_FS */ |
82 | 83 | ||
83 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } | 84 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } |
84 | static inline void rpc_count_iostats(struct rpc_task *task) {} | 85 | static inline void rpc_count_iostats(const struct rpc_task *task, |
86 | struct rpc_iostats *stats) {} | ||
85 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} | 87 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} |
86 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} | 88 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} |
87 | 89 | ||
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 2bb03d77375a..a7b422b33eda 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -21,21 +21,26 @@ struct rpc_pipe_ops { | |||
21 | void (*destroy_msg)(struct rpc_pipe_msg *); | 21 | void (*destroy_msg)(struct rpc_pipe_msg *); |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct rpc_inode { | 24 | struct rpc_pipe { |
25 | struct inode vfs_inode; | ||
26 | void *private; | ||
27 | struct list_head pipe; | 25 | struct list_head pipe; |
28 | struct list_head in_upcall; | 26 | struct list_head in_upcall; |
29 | struct list_head in_downcall; | 27 | struct list_head in_downcall; |
30 | int pipelen; | 28 | int pipelen; |
31 | int nreaders; | 29 | int nreaders; |
32 | int nwriters; | 30 | int nwriters; |
33 | int nkern_readwriters; | ||
34 | wait_queue_head_t waitq; | ||
35 | #define RPC_PIPE_WAIT_FOR_OPEN 1 | 31 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
36 | int flags; | 32 | int flags; |
37 | struct delayed_work queue_timeout; | 33 | struct delayed_work queue_timeout; |
38 | const struct rpc_pipe_ops *ops; | 34 | const struct rpc_pipe_ops *ops; |
35 | spinlock_t lock; | ||
36 | struct dentry *dentry; | ||
37 | }; | ||
38 | |||
39 | struct rpc_inode { | ||
40 | struct inode vfs_inode; | ||
41 | void *private; | ||
42 | struct rpc_pipe *pipe; | ||
43 | wait_queue_head_t waitq; | ||
39 | }; | 44 | }; |
40 | 45 | ||
41 | static inline struct rpc_inode * | 46 | static inline struct rpc_inode * |
@@ -44,9 +49,28 @@ RPC_I(struct inode *inode) | |||
44 | return container_of(inode, struct rpc_inode, vfs_inode); | 49 | return container_of(inode, struct rpc_inode, vfs_inode); |
45 | } | 50 | } |
46 | 51 | ||
52 | enum { | ||
53 | SUNRPC_PIPEFS_NFS_PRIO, | ||
54 | SUNRPC_PIPEFS_RPC_PRIO, | ||
55 | }; | ||
56 | |||
57 | extern int rpc_pipefs_notifier_register(struct notifier_block *); | ||
58 | extern void rpc_pipefs_notifier_unregister(struct notifier_block *); | ||
59 | |||
60 | enum { | ||
61 | RPC_PIPEFS_MOUNT, | ||
62 | RPC_PIPEFS_UMOUNT, | ||
63 | }; | ||
64 | |||
65 | extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb, | ||
66 | const unsigned char *dir_name); | ||
67 | extern void rpc_pipefs_init_net(struct net *net); | ||
68 | extern struct super_block *rpc_get_sb_net(const struct net *net); | ||
69 | extern void rpc_put_sb_net(const struct net *net); | ||
70 | |||
47 | extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, | 71 | extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, |
48 | char __user *, size_t); | 72 | char __user *, size_t); |
49 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | 73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); |
50 | 74 | ||
51 | struct rpc_clnt; | 75 | struct rpc_clnt; |
52 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); | 76 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); |
@@ -59,11 +83,13 @@ extern struct dentry *rpc_create_cache_dir(struct dentry *, | |||
59 | struct cache_detail *); | 83 | struct cache_detail *); |
60 | extern void rpc_remove_cache_dir(struct dentry *); | 84 | extern void rpc_remove_cache_dir(struct dentry *); |
61 | 85 | ||
62 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, | 86 | extern int rpc_rmdir(struct dentry *dentry); |
63 | const struct rpc_pipe_ops *, int flags); | 87 | |
88 | struct rpc_pipe *rpc_mkpipe_data(const struct rpc_pipe_ops *ops, int flags); | ||
89 | void rpc_destroy_pipe_data(struct rpc_pipe *pipe); | ||
90 | extern struct dentry *rpc_mkpipe_dentry(struct dentry *, const char *, void *, | ||
91 | struct rpc_pipe *); | ||
64 | extern int rpc_unlink(struct dentry *); | 92 | extern int rpc_unlink(struct dentry *); |
65 | extern struct vfsmount *rpc_get_mount(void); | ||
66 | extern void rpc_put_mount(void); | ||
67 | extern int register_rpc_pipefs(void); | 93 | extern int register_rpc_pipefs(void); |
68 | extern void unregister_rpc_pipefs(void); | 94 | extern void unregister_rpc_pipefs(void); |
69 | 95 | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index e7756896f3ca..dc0c3cc3ada3 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -103,6 +103,7 @@ typedef void (*rpc_action)(struct rpc_task *); | |||
103 | struct rpc_call_ops { | 103 | struct rpc_call_ops { |
104 | void (*rpc_call_prepare)(struct rpc_task *, void *); | 104 | void (*rpc_call_prepare)(struct rpc_task *, void *); |
105 | void (*rpc_call_done)(struct rpc_task *, void *); | 105 | void (*rpc_call_done)(struct rpc_task *, void *); |
106 | void (*rpc_count_stats)(struct rpc_task *, void *); | ||
106 | void (*rpc_release)(void *); | 107 | void (*rpc_release)(void *); |
107 | }; | 108 | }; |
108 | 109 | ||
@@ -195,7 +196,7 @@ struct rpc_wait_queue { | |||
195 | unsigned char nr; /* # tasks remaining for cookie */ | 196 | unsigned char nr; /* # tasks remaining for cookie */ |
196 | unsigned short qlen; /* total # tasks waiting in queue */ | 197 | unsigned short qlen; /* total # tasks waiting in queue */ |
197 | struct rpc_timer timer_list; | 198 | struct rpc_timer timer_list; |
198 | #ifdef RPC_DEBUG | 199 | #if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS) |
199 | const char * name; | 200 | const char * name; |
200 | #endif | 201 | #endif |
201 | }; | 202 | }; |
@@ -235,6 +236,9 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *, | |||
235 | struct rpc_task *); | 236 | struct rpc_task *); |
236 | void rpc_wake_up(struct rpc_wait_queue *); | 237 | void rpc_wake_up(struct rpc_wait_queue *); |
237 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | 238 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
239 | struct rpc_task *rpc_wake_up_first(struct rpc_wait_queue *, | ||
240 | bool (*)(struct rpc_task *, void *), | ||
241 | void *); | ||
238 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 242 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
239 | int rpc_queue_empty(struct rpc_wait_queue *); | 243 | int rpc_queue_empty(struct rpc_wait_queue *); |
240 | void rpc_delay(struct rpc_task *, unsigned long); | 244 | void rpc_delay(struct rpc_task *, unsigned long); |
@@ -244,7 +248,8 @@ int rpciod_up(void); | |||
244 | void rpciod_down(void); | 248 | void rpciod_down(void); |
245 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 249 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); |
246 | #ifdef RPC_DEBUG | 250 | #ifdef RPC_DEBUG |
247 | void rpc_show_tasks(void); | 251 | struct net; |
252 | void rpc_show_tasks(struct net *); | ||
248 | #endif | 253 | #endif |
249 | int rpc_init_mempool(void); | 254 | int rpc_init_mempool(void); |
250 | void rpc_destroy_mempool(void); | 255 | void rpc_destroy_mempool(void); |
@@ -266,11 +271,22 @@ static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char pri | |||
266 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); | 271 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); |
267 | } | 272 | } |
268 | 273 | ||
269 | #ifdef RPC_DEBUG | 274 | #if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) |
270 | static inline const char * rpc_qname(struct rpc_wait_queue *q) | 275 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) |
271 | { | 276 | { |
272 | return ((q && q->name) ? q->name : "unknown"); | 277 | return ((q && q->name) ? q->name : "unknown"); |
273 | } | 278 | } |
279 | |||
280 | static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q, | ||
281 | const char *name) | ||
282 | { | ||
283 | q->name = name; | ||
284 | } | ||
285 | #else | ||
286 | static inline void rpc_assign_waitqueue_name(struct rpc_wait_queue *q, | ||
287 | const char *name) | ||
288 | { | ||
289 | } | ||
274 | #endif | 290 | #endif |
275 | 291 | ||
276 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ | 292 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ |
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index 680471d1f28a..edc64219f92b 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
13 | 13 | ||
14 | struct rpc_stat { | 14 | struct rpc_stat { |
15 | struct rpc_program * program; | 15 | const struct rpc_program *program; |
16 | 16 | ||
17 | unsigned int netcnt, | 17 | unsigned int netcnt, |
18 | netudpcnt, | 18 | netudpcnt, |
@@ -58,24 +58,24 @@ void rpc_modcount(struct inode *, int); | |||
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef CONFIG_PROC_FS | 60 | #ifdef CONFIG_PROC_FS |
61 | struct proc_dir_entry * rpc_proc_register(struct rpc_stat *); | 61 | struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); |
62 | void rpc_proc_unregister(const char *); | 62 | void rpc_proc_unregister(struct net *,const char *); |
63 | void rpc_proc_zero(struct rpc_program *); | 63 | void rpc_proc_zero(const struct rpc_program *); |
64 | struct proc_dir_entry * svc_proc_register(struct svc_stat *, | 64 | struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *, |
65 | const struct file_operations *); | 65 | const struct file_operations *); |
66 | void svc_proc_unregister(const char *); | 66 | void svc_proc_unregister(struct net *, const char *); |
67 | 67 | ||
68 | void svc_seq_show(struct seq_file *, | 68 | void svc_seq_show(struct seq_file *, |
69 | const struct svc_stat *); | 69 | const struct svc_stat *); |
70 | #else | 70 | #else |
71 | 71 | ||
72 | static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; } | 72 | static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; } |
73 | static inline void rpc_proc_unregister(const char *p) {} | 73 | static inline void rpc_proc_unregister(struct net *net, const char *p) {} |
74 | static inline void rpc_proc_zero(struct rpc_program *p) {} | 74 | static inline void rpc_proc_zero(const struct rpc_program *p) {} |
75 | 75 | ||
76 | static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s, | 76 | static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s, |
77 | const struct file_operations *f) { return NULL; } | 77 | const struct file_operations *f) { return NULL; } |
78 | static inline void svc_proc_unregister(const char *p) {} | 78 | static inline void svc_proc_unregister(struct net *net, const char *p) {} |
79 | 79 | ||
80 | static inline void svc_seq_show(struct seq_file *seq, | 80 | static inline void svc_seq_show(struct seq_file *seq, |
81 | const struct svc_stat *st) {} | 81 | const struct svc_stat *st) {} |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 35b37b1e9299..51b29ac45a8e 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -84,7 +84,8 @@ struct svc_serv { | |||
84 | unsigned int sv_nrpools; /* number of thread pools */ | 84 | unsigned int sv_nrpools; /* number of thread pools */ |
85 | struct svc_pool * sv_pools; /* array of thread pools */ | 85 | struct svc_pool * sv_pools; /* array of thread pools */ |
86 | 86 | ||
87 | void (*sv_shutdown)(struct svc_serv *serv); | 87 | void (*sv_shutdown)(struct svc_serv *serv, |
88 | struct net *net); | ||
88 | /* Callback to use when last thread | 89 | /* Callback to use when last thread |
89 | * exits. | 90 | * exits. |
90 | */ | 91 | */ |
@@ -413,22 +414,24 @@ struct svc_procedure { | |||
413 | /* | 414 | /* |
414 | * Function prototypes. | 415 | * Function prototypes. |
415 | */ | 416 | */ |
416 | void svc_rpcb_cleanup(struct svc_serv *serv); | 417 | int svc_rpcb_setup(struct svc_serv *serv, struct net *net); |
418 | void svc_rpcb_cleanup(struct svc_serv *serv, struct net *net); | ||
417 | struct svc_serv *svc_create(struct svc_program *, unsigned int, | 419 | struct svc_serv *svc_create(struct svc_program *, unsigned int, |
418 | void (*shutdown)(struct svc_serv *)); | 420 | void (*shutdown)(struct svc_serv *, struct net *net)); |
419 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 421 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
420 | struct svc_pool *pool, int node); | 422 | struct svc_pool *pool, int node); |
421 | void svc_exit_thread(struct svc_rqst *); | 423 | void svc_exit_thread(struct svc_rqst *); |
422 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 424 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
423 | void (*shutdown)(struct svc_serv *), | 425 | void (*shutdown)(struct svc_serv *, struct net *net), |
424 | svc_thread_fn, struct module *); | 426 | svc_thread_fn, struct module *); |
425 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | 427 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); |
426 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 428 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
427 | void svc_destroy(struct svc_serv *); | 429 | void svc_destroy(struct svc_serv *); |
430 | void svc_shutdown_net(struct svc_serv *, struct net *); | ||
428 | int svc_process(struct svc_rqst *); | 431 | int svc_process(struct svc_rqst *); |
429 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | 432 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, |
430 | struct svc_rqst *); | 433 | struct svc_rqst *); |
431 | int svc_register(const struct svc_serv *, const int, | 434 | int svc_register(const struct svc_serv *, struct net *, const int, |
432 | const unsigned short, const unsigned short); | 435 | const unsigned short, const unsigned short); |
433 | 436 | ||
434 | void svc_wake_up(struct svc_serv *); | 437 | void svc_wake_up(struct svc_serv *); |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index dfa900948af7..b3f64b12f141 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -121,7 +121,8 @@ void svc_close_xprt(struct svc_xprt *xprt); | |||
121 | int svc_port_is_privileged(struct sockaddr *sin); | 121 | int svc_port_is_privileged(struct sockaddr *sin); |
122 | int svc_print_xprts(char *buf, int maxlen); | 122 | int svc_print_xprts(char *buf, int maxlen); |
123 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, | 123 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, |
124 | const sa_family_t af, const unsigned short port); | 124 | struct net *net, const sa_family_t af, |
125 | const unsigned short port); | ||
125 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); | 126 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); |
126 | 127 | ||
127 | static inline void svc_xprt_get(struct svc_xprt *xprt) | 128 | static inline void svc_xprt_get(struct svc_xprt *xprt) |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index 25d333c1b571..548790e9113b 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -135,6 +135,9 @@ extern void svcauth_unix_purge(void); | |||
135 | extern void svcauth_unix_info_release(struct svc_xprt *xpt); | 135 | extern void svcauth_unix_info_release(struct svc_xprt *xpt); |
136 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); | 136 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); |
137 | 137 | ||
138 | extern int unix_gid_cache_create(struct net *net); | ||
139 | extern void unix_gid_cache_destroy(struct net *net); | ||
140 | |||
138 | static inline unsigned long hash_str(char *name, int bits) | 141 | static inline unsigned long hash_str(char *name, int bits) |
139 | { | 142 | { |
140 | unsigned long hash = 0; | 143 | unsigned long hash = 0; |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 83bbee3f089c..7c32daa025eb 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | int gss_svc_init(void); | 19 | int gss_svc_init(void); |
20 | void gss_svc_shutdown(void); | 20 | void gss_svc_shutdown(void); |
21 | int gss_svc_init_net(struct net *net); | ||
22 | void gss_svc_shutdown_net(struct net *net); | ||
21 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); | 23 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); |
22 | u32 svcauth_gss_flavor(struct auth_domain *dom); | 24 | u32 svcauth_gss_flavor(struct auth_domain *dom); |
23 | char *svc_gss_principal(struct svc_rqst *); | 25 | char *svc_gss_principal(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index c84e9741cb2a..cb4ac69e1f33 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -34,7 +34,7 @@ struct svc_sock { | |||
34 | /* | 34 | /* |
35 | * Function prototypes. | 35 | * Function prototypes. |
36 | */ | 36 | */ |
37 | void svc_close_all(struct svc_serv *); | 37 | void svc_close_net(struct svc_serv *, struct net *); |
38 | int svc_recv(struct svc_rqst *, long); | 38 | int svc_recv(struct svc_rqst *, long); |
39 | int svc_send(struct svc_rqst *); | 39 | int svc_send(struct svc_rqst *); |
40 | void svc_drop(struct svc_rqst *); | 40 | void svc_drop(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 15518a152ac3..77d278defa70 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -21,8 +21,8 @@ | |||
21 | 21 | ||
22 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
23 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
24 | #define RPC_MAX_SLOT_TABLE (128U) | ||
25 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) | 24 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) |
25 | #define RPC_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE_LIMIT | ||
26 | 26 | ||
27 | /* | 27 | /* |
28 | * This describes a timeout strategy | 28 | * This describes a timeout strategy |
@@ -219,13 +219,17 @@ struct rpc_xprt { | |||
219 | connect_time, /* jiffies waiting for connect */ | 219 | connect_time, /* jiffies waiting for connect */ |
220 | sends, /* how many complete requests */ | 220 | sends, /* how many complete requests */ |
221 | recvs, /* how many complete requests */ | 221 | recvs, /* how many complete requests */ |
222 | bad_xids; /* lookup_rqst didn't find XID */ | 222 | bad_xids, /* lookup_rqst didn't find XID */ |
223 | max_slots; /* max rpc_slots used */ | ||
223 | 224 | ||
224 | unsigned long long req_u, /* average requests on the wire */ | 225 | unsigned long long req_u, /* average requests on the wire */ |
225 | bklog_u; /* backlog queue utilization */ | 226 | bklog_u, /* backlog queue utilization */ |
227 | sending_u, /* send q utilization */ | ||
228 | pending_u; /* pend q utilization */ | ||
226 | } stat; | 229 | } stat; |
227 | 230 | ||
228 | struct net *xprt_net; | 231 | struct net *xprt_net; |
232 | const char *servername; | ||
229 | const char *address_strings[RPC_DISPLAY_MAX]; | 233 | const char *address_strings[RPC_DISPLAY_MAX]; |
230 | }; | 234 | }; |
231 | 235 | ||
@@ -255,6 +259,7 @@ struct xprt_create { | |||
255 | struct sockaddr * srcaddr; /* optional local address */ | 259 | struct sockaddr * srcaddr; /* optional local address */ |
256 | struct sockaddr * dstaddr; /* remote peer address */ | 260 | struct sockaddr * dstaddr; /* remote peer address */ |
257 | size_t addrlen; | 261 | size_t addrlen; |
262 | const char *servername; | ||
258 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | 263 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
259 | }; | 264 | }; |
260 | 265 | ||
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 3f14a02e9cc0..1ad36cc25b2e 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
@@ -12,18 +12,6 @@ | |||
12 | int init_socket_xprt(void); | 12 | int init_socket_xprt(void); |
13 | void cleanup_socket_xprt(void); | 13 | void cleanup_socket_xprt(void); |
14 | 14 | ||
15 | /* | ||
16 | * RPC slot table sizes for UDP, TCP transports | ||
17 | */ | ||
18 | extern unsigned int xprt_udp_slot_table_entries; | ||
19 | extern unsigned int xprt_tcp_slot_table_entries; | ||
20 | |||
21 | /* | ||
22 | * Parameters for choosing a free port | ||
23 | */ | ||
24 | extern unsigned int xprt_min_resvport; | ||
25 | extern unsigned int xprt_max_resvport; | ||
26 | |||
27 | #define RPC_MIN_RESVPORT (1U) | 15 | #define RPC_MIN_RESVPORT (1U) |
28 | #define RPC_MAX_RESVPORT (65535U) | 16 | #define RPC_MAX_RESVPORT (65535U) |
29 | #define RPC_DEF_MIN_RESVPORT (665U) | 17 | #define RPC_DEF_MIN_RESVPORT (665U) |