diff options
| author | David S. Miller <davem@davemloft.net> | 2012-05-07 23:35:40 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-05-07 23:35:40 -0400 |
| commit | 0d6c4a2e4641bbc556dd74d3aa158c413a972492 (patch) | |
| tree | da944af17682659bb433dc2282dcb48380c14cd1 /net/sunrpc | |
| parent | 6e06c0e2347ec79d0bd5702b2438fe883f784545 (diff) | |
| parent | 1c430a727fa512500a422ffe4712166c550ea06a (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/intel/e1000e/param.c
drivers/net/wireless/iwlwifi/iwl-agn-rx.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
drivers/net/wireless/iwlwifi/iwl-trans.h
Resolved the iwlwifi conflict with mainline using 3-way diff posted
by John Linville and Stephen Rothwell. In 'net' we added a bug
fix to make iwlwifi report a more accurate skb->truesize but this
conflicted with RX path changes that happened meanwhile in net-next.
In e1000e a conflict arose in the validation code for settings of
adapter->itr. 'net-next' had more sophisticated logic so that
logic was used.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc')
| -rw-r--r-- | net/sunrpc/clnt.c | 50 | ||||
| -rw-r--r-- | net/sunrpc/rpc_pipe.c | 3 | ||||
| -rw-r--r-- | net/sunrpc/sunrpc_syms.c | 17 |
3 files changed, 50 insertions, 20 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 67972462a543..adf2990acebf 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
| @@ -176,16 +176,22 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, const char *dir_name) | |||
| 176 | return 0; | 176 | return 0; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | static int __rpc_pipefs_event(struct rpc_clnt *clnt, unsigned long event, | 179 | static inline int rpc_clnt_skip_event(struct rpc_clnt *clnt, unsigned long event) |
| 180 | struct super_block *sb) | 180 | { |
| 181 | if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || | ||
| 182 | ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry)) | ||
| 183 | return 1; | ||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | |||
| 187 | static int __rpc_clnt_handle_event(struct rpc_clnt *clnt, unsigned long event, | ||
| 188 | struct super_block *sb) | ||
| 181 | { | 189 | { |
| 182 | struct dentry *dentry; | 190 | struct dentry *dentry; |
| 183 | int err = 0; | 191 | int err = 0; |
| 184 | 192 | ||
| 185 | switch (event) { | 193 | switch (event) { |
| 186 | case RPC_PIPEFS_MOUNT: | 194 | case RPC_PIPEFS_MOUNT: |
| 187 | if (clnt->cl_program->pipe_dir_name == NULL) | ||
| 188 | break; | ||
| 189 | dentry = rpc_setup_pipedir_sb(sb, clnt, | 195 | dentry = rpc_setup_pipedir_sb(sb, clnt, |
| 190 | clnt->cl_program->pipe_dir_name); | 196 | clnt->cl_program->pipe_dir_name); |
| 191 | BUG_ON(dentry == NULL); | 197 | BUG_ON(dentry == NULL); |
| @@ -208,6 +214,20 @@ static int __rpc_pipefs_event(struct rpc_clnt *clnt, unsigned long event, | |||
| 208 | return err; | 214 | return err; |
| 209 | } | 215 | } |
| 210 | 216 | ||
| 217 | static int __rpc_pipefs_event(struct rpc_clnt *clnt, unsigned long event, | ||
| 218 | struct super_block *sb) | ||
| 219 | { | ||
| 220 | int error = 0; | ||
| 221 | |||
| 222 | for (;; clnt = clnt->cl_parent) { | ||
| 223 | if (!rpc_clnt_skip_event(clnt, event)) | ||
| 224 | error = __rpc_clnt_handle_event(clnt, event, sb); | ||
| 225 | if (error || clnt == clnt->cl_parent) | ||
| 226 | break; | ||
| 227 | } | ||
| 228 | return error; | ||
| 229 | } | ||
| 230 | |||
| 211 | static struct rpc_clnt *rpc_get_client_for_event(struct net *net, int event) | 231 | static struct rpc_clnt *rpc_get_client_for_event(struct net *net, int event) |
| 212 | { | 232 | { |
| 213 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | 233 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); |
| @@ -215,10 +235,12 @@ static struct rpc_clnt *rpc_get_client_for_event(struct net *net, int event) | |||
| 215 | 235 | ||
| 216 | spin_lock(&sn->rpc_client_lock); | 236 | spin_lock(&sn->rpc_client_lock); |
| 217 | list_for_each_entry(clnt, &sn->all_clients, cl_clients) { | 237 | list_for_each_entry(clnt, &sn->all_clients, cl_clients) { |
| 218 | if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || | 238 | if (clnt->cl_program->pipe_dir_name == NULL) |
| 219 | ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry)) | 239 | break; |
| 240 | if (rpc_clnt_skip_event(clnt, event)) | ||
| 241 | continue; | ||
| 242 | if (atomic_inc_not_zero(&clnt->cl_count) == 0) | ||
| 220 | continue; | 243 | continue; |
| 221 | atomic_inc(&clnt->cl_count); | ||
| 222 | spin_unlock(&sn->rpc_client_lock); | 244 | spin_unlock(&sn->rpc_client_lock); |
| 223 | return clnt; | 245 | return clnt; |
| 224 | } | 246 | } |
| @@ -257,6 +279,14 @@ void rpc_clients_notifier_unregister(void) | |||
| 257 | return rpc_pipefs_notifier_unregister(&rpc_clients_block); | 279 | return rpc_pipefs_notifier_unregister(&rpc_clients_block); |
| 258 | } | 280 | } |
| 259 | 281 | ||
| 282 | static void rpc_clnt_set_nodename(struct rpc_clnt *clnt, const char *nodename) | ||
| 283 | { | ||
| 284 | clnt->cl_nodelen = strlen(nodename); | ||
| 285 | if (clnt->cl_nodelen > UNX_MAXNODENAME) | ||
| 286 | clnt->cl_nodelen = UNX_MAXNODENAME; | ||
| 287 | memcpy(clnt->cl_nodename, nodename, clnt->cl_nodelen); | ||
| 288 | } | ||
| 289 | |||
| 260 | static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) | 290 | static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) |
| 261 | { | 291 | { |
| 262 | const struct rpc_program *program = args->program; | 292 | const struct rpc_program *program = args->program; |
| @@ -337,10 +367,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru | |||
| 337 | } | 367 | } |
| 338 | 368 | ||
| 339 | /* save the nodename */ | 369 | /* save the nodename */ |
| 340 | clnt->cl_nodelen = strlen(init_utsname()->nodename); | 370 | rpc_clnt_set_nodename(clnt, utsname()->nodename); |
| 341 | if (clnt->cl_nodelen > UNX_MAXNODENAME) | ||
| 342 | clnt->cl_nodelen = UNX_MAXNODENAME; | ||
| 343 | memcpy(clnt->cl_nodename, init_utsname()->nodename, clnt->cl_nodelen); | ||
| 344 | rpc_register_client(clnt); | 371 | rpc_register_client(clnt); |
| 345 | return clnt; | 372 | return clnt; |
| 346 | 373 | ||
| @@ -499,6 +526,7 @@ rpc_clone_client(struct rpc_clnt *clnt) | |||
| 499 | err = rpc_setup_pipedir(new, clnt->cl_program->pipe_dir_name); | 526 | err = rpc_setup_pipedir(new, clnt->cl_program->pipe_dir_name); |
| 500 | if (err != 0) | 527 | if (err != 0) |
| 501 | goto out_no_path; | 528 | goto out_no_path; |
| 529 | rpc_clnt_set_nodename(new, utsname()->nodename); | ||
| 502 | if (new->cl_auth) | 530 | if (new->cl_auth) |
| 503 | atomic_inc(&new->cl_auth->au_count); | 531 | atomic_inc(&new->cl_auth->au_count); |
| 504 | atomic_inc(&clnt->cl_count); | 532 | atomic_inc(&clnt->cl_count); |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 0af37fc46818..3b62cf288031 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
| @@ -1126,19 +1126,20 @@ rpc_fill_super(struct super_block *sb, void *data, int silent) | |||
| 1126 | return -ENOMEM; | 1126 | return -ENOMEM; |
| 1127 | dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n", net, | 1127 | dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n", net, |
| 1128 | NET_NAME(net)); | 1128 | NET_NAME(net)); |
| 1129 | sn->pipefs_sb = sb; | ||
| 1129 | err = blocking_notifier_call_chain(&rpc_pipefs_notifier_list, | 1130 | err = blocking_notifier_call_chain(&rpc_pipefs_notifier_list, |
| 1130 | RPC_PIPEFS_MOUNT, | 1131 | RPC_PIPEFS_MOUNT, |
| 1131 | sb); | 1132 | sb); |
| 1132 | if (err) | 1133 | if (err) |
| 1133 | goto err_depopulate; | 1134 | goto err_depopulate; |
| 1134 | sb->s_fs_info = get_net(net); | 1135 | sb->s_fs_info = get_net(net); |
| 1135 | sn->pipefs_sb = sb; | ||
| 1136 | return 0; | 1136 | return 0; |
| 1137 | 1137 | ||
| 1138 | err_depopulate: | 1138 | err_depopulate: |
| 1139 | blocking_notifier_call_chain(&rpc_pipefs_notifier_list, | 1139 | blocking_notifier_call_chain(&rpc_pipefs_notifier_list, |
| 1140 | RPC_PIPEFS_UMOUNT, | 1140 | RPC_PIPEFS_UMOUNT, |
| 1141 | sb); | 1141 | sb); |
| 1142 | sn->pipefs_sb = NULL; | ||
| 1142 | __rpc_depopulate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF); | 1143 | __rpc_depopulate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF); |
| 1143 | return err; | 1144 | return err; |
| 1144 | } | 1145 | } |
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 8adfc88e793a..3d6498af9adc 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
| @@ -75,20 +75,21 @@ static struct pernet_operations sunrpc_net_ops = { | |||
| 75 | static int __init | 75 | static int __init |
| 76 | init_sunrpc(void) | 76 | init_sunrpc(void) |
| 77 | { | 77 | { |
| 78 | int err = register_rpc_pipefs(); | 78 | int err = rpc_init_mempool(); |
| 79 | if (err) | 79 | if (err) |
| 80 | goto out; | 80 | goto out; |
| 81 | err = rpc_init_mempool(); | ||
| 82 | if (err) | ||
| 83 | goto out2; | ||
| 84 | err = rpcauth_init_module(); | 81 | err = rpcauth_init_module(); |
| 85 | if (err) | 82 | if (err) |
| 86 | goto out3; | 83 | goto out2; |
| 87 | 84 | ||
| 88 | cache_initialize(); | 85 | cache_initialize(); |
| 89 | 86 | ||
| 90 | err = register_pernet_subsys(&sunrpc_net_ops); | 87 | err = register_pernet_subsys(&sunrpc_net_ops); |
| 91 | if (err) | 88 | if (err) |
| 89 | goto out3; | ||
| 90 | |||
| 91 | err = register_rpc_pipefs(); | ||
| 92 | if (err) | ||
| 92 | goto out4; | 93 | goto out4; |
| 93 | #ifdef RPC_DEBUG | 94 | #ifdef RPC_DEBUG |
| 94 | rpc_register_sysctl(); | 95 | rpc_register_sysctl(); |
| @@ -98,11 +99,11 @@ init_sunrpc(void) | |||
| 98 | return 0; | 99 | return 0; |
| 99 | 100 | ||
| 100 | out4: | 101 | out4: |
| 101 | rpcauth_remove_module(); | 102 | unregister_pernet_subsys(&sunrpc_net_ops); |
| 102 | out3: | 103 | out3: |
| 103 | rpc_destroy_mempool(); | 104 | rpcauth_remove_module(); |
| 104 | out2: | 105 | out2: |
| 105 | unregister_rpc_pipefs(); | 106 | rpc_destroy_mempool(); |
| 106 | out: | 107 | out: |
| 107 | return err; | 108 | return err; |
| 108 | } | 109 | } |
