diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-08-20 10:00:36 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-01 18:25:47 -0400 |
commit | bbe0a3aa4e227c8aae02a484ce1c0b655cd19055 (patch) | |
tree | 22b02b554f7b3abea3fabb92f3856aec7e84b762 | |
parent | 23c20ecd44750dd42e5fd53285a17ca8d8a9b0a3 (diff) |
NFS: make nfs_callback_tcpport per network context
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/callback.c | 6 | ||||
-rw-r--r-- | fs/nfs/callback.h | 1 | ||||
-rw-r--r-- | fs/nfs/netns.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 4 |
4 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 64e87ec045aa..94aa9d8f3086 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "nfs4_fs.h" | 23 | #include "nfs4_fs.h" |
24 | #include "callback.h" | 24 | #include "callback.h" |
25 | #include "internal.h" | 25 | #include "internal.h" |
26 | #include "netns.h" | ||
26 | 27 | ||
27 | #define NFSDBG_FACILITY NFSDBG_CALLBACK | 28 | #define NFSDBG_FACILITY NFSDBG_CALLBACK |
28 | 29 | ||
@@ -42,14 +43,15 @@ unsigned short nfs_callback_tcpport6; | |||
42 | static int nfs4_callback_up_net(struct svc_serv *serv, struct net *net) | 43 | static int nfs4_callback_up_net(struct svc_serv *serv, struct net *net) |
43 | { | 44 | { |
44 | int ret; | 45 | int ret; |
46 | struct nfs_net *nn = net_generic(net, nfs_net_id); | ||
45 | 47 | ||
46 | ret = svc_create_xprt(serv, "tcp", net, PF_INET, | 48 | ret = svc_create_xprt(serv, "tcp", net, PF_INET, |
47 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); | 49 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); |
48 | if (ret <= 0) | 50 | if (ret <= 0) |
49 | goto out_err; | 51 | goto out_err; |
50 | nfs_callback_tcpport = ret; | 52 | nn->nfs_callback_tcpport = ret; |
51 | dprintk("NFS: Callback listener port = %u (af %u, net %p)\n", | 53 | dprintk("NFS: Callback listener port = %u (af %u, net %p)\n", |
52 | nfs_callback_tcpport, PF_INET, net); | 54 | nn->nfs_callback_tcpport, PF_INET, net); |
53 | 55 | ||
54 | ret = svc_create_xprt(serv, "tcp", net, PF_INET6, | 56 | ret = svc_create_xprt(serv, "tcp", net, PF_INET6, |
55 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); | 57 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); |
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index 309404453e95..1c167d163683 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -208,7 +208,6 @@ extern int nfs4_set_callback_sessionid(struct nfs_client *clp); | |||
208 | #define NFS41_BC_MAX_CALLBACKS 1 | 208 | #define NFS41_BC_MAX_CALLBACKS 1 |
209 | 209 | ||
210 | extern unsigned int nfs_callback_set_tcpport; | 210 | extern unsigned int nfs_callback_set_tcpport; |
211 | extern unsigned short nfs_callback_tcpport; | ||
212 | extern unsigned short nfs_callback_tcpport6; | 211 | extern unsigned short nfs_callback_tcpport6; |
213 | 212 | ||
214 | #endif /* __LINUX_FS_NFS_CALLBACK_H */ | 213 | #endif /* __LINUX_FS_NFS_CALLBACK_H */ |
diff --git a/fs/nfs/netns.h b/fs/nfs/netns.h index 0539de1b8d1f..1538d3a83cde 100644 --- a/fs/nfs/netns.h +++ b/fs/nfs/netns.h | |||
@@ -22,6 +22,7 @@ struct nfs_net { | |||
22 | struct list_head nfs_volume_list; | 22 | struct list_head nfs_volume_list; |
23 | #if IS_ENABLED(CONFIG_NFS_V4) | 23 | #if IS_ENABLED(CONFIG_NFS_V4) |
24 | struct idr cb_ident_idr; /* Protected by nfs_client_lock */ | 24 | struct idr cb_ident_idr; /* Protected by nfs_client_lock */ |
25 | unsigned short nfs_callback_tcpport; | ||
25 | #endif | 26 | #endif |
26 | spinlock_t nfs_client_lock; | 27 | spinlock_t nfs_client_lock; |
27 | struct timespec boot_time; | 28 | struct timespec boot_time; |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index a5331ec094a6..716cdc20475f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include "delegation.h" | 56 | #include "delegation.h" |
57 | #include "internal.h" | 57 | #include "internal.h" |
58 | #include "pnfs.h" | 58 | #include "pnfs.h" |
59 | #include "netns.h" | ||
59 | 60 | ||
60 | #define NFSDBG_FACILITY NFSDBG_STATE | 61 | #define NFSDBG_FACILITY NFSDBG_STATE |
61 | 62 | ||
@@ -73,10 +74,11 @@ int nfs4_init_clientid(struct nfs_client *clp, struct rpc_cred *cred) | |||
73 | }; | 74 | }; |
74 | unsigned short port; | 75 | unsigned short port; |
75 | int status; | 76 | int status; |
77 | struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id); | ||
76 | 78 | ||
77 | if (test_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state)) | 79 | if (test_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state)) |
78 | goto do_confirm; | 80 | goto do_confirm; |
79 | port = nfs_callback_tcpport; | 81 | port = nn->nfs_callback_tcpport; |
80 | if (clp->cl_addr.ss_family == AF_INET6) | 82 | if (clp->cl_addr.ss_family == AF_INET6) |
81 | port = nfs_callback_tcpport6; | 83 | port = nfs_callback_tcpport6; |
82 | 84 | ||