diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-01 09:22:56 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 16:06:01 -0400 |
commit | 7146851376861fe55c7a48ac8fc1354a5fff6cd0 (patch) | |
tree | 44c9a7427a3f1cea41c15a07d2aa63bbdeaf8936 /fs/nfs/client.c | |
parent | 9bdaa86d2a4cbf9a71de3048c0c0a874e7ebc8ad (diff) |
nfs41: minorversion support for nfs4_{init,destroy}_callback
move nfs4_init_callback into nfs4_init_client_minor_version
and nfs4_destroy_callback into nfs4_clear_client_minor_version
as these need to happen also when auto-negotiating the minorversion
once the callback service for nfs41 becomes different than for nfs4.0
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: Fix checkpatch warning]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[Type check arguments of nfs_callback_up]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: Backchannel: Remove FIXME comment]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index d9657d45573..df2b40d1883 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -47,9 +47,6 @@ | |||
47 | #include "internal.h" | 47 | #include "internal.h" |
48 | #include "fscache.h" | 48 | #include "fscache.h" |
49 | 49 | ||
50 | static int nfs4_init_callback(struct nfs_client *); | ||
51 | static void nfs4_destroy_callback(struct nfs_client *); | ||
52 | |||
53 | #define NFSDBG_FACILITY NFSDBG_CLIENT | 50 | #define NFSDBG_FACILITY NFSDBG_CLIENT |
54 | 51 | ||
55 | static DEFINE_SPINLOCK(nfs_client_lock); | 52 | static DEFINE_SPINLOCK(nfs_client_lock); |
@@ -124,9 +121,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_ | |||
124 | 121 | ||
125 | clp->rpc_ops = cl_init->rpc_ops; | 122 | clp->rpc_ops = cl_init->rpc_ops; |
126 | 123 | ||
127 | if (nfs4_init_callback(clp) < 0) | ||
128 | goto error_2; | ||
129 | |||
130 | atomic_set(&clp->cl_count, 1); | 124 | atomic_set(&clp->cl_count, 1); |
131 | clp->cl_cons_state = NFS_CS_INITING; | 125 | clp->cl_cons_state = NFS_CS_INITING; |
132 | 126 | ||
@@ -136,7 +130,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_ | |||
136 | if (cl_init->hostname) { | 130 | if (cl_init->hostname) { |
137 | clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL); | 131 | clp->cl_hostname = kstrdup(cl_init->hostname, GFP_KERNEL); |
138 | if (!clp->cl_hostname) | 132 | if (!clp->cl_hostname) |
139 | goto error_3; | 133 | goto error_cleanup; |
140 | } | 134 | } |
141 | 135 | ||
142 | INIT_LIST_HEAD(&clp->cl_superblocks); | 136 | INIT_LIST_HEAD(&clp->cl_superblocks); |
@@ -161,9 +155,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_ | |||
161 | 155 | ||
162 | return clp; | 156 | return clp; |
163 | 157 | ||
164 | error_3: | 158 | error_cleanup: |
165 | nfs4_destroy_callback(clp); | ||
166 | error_2: | ||
167 | kfree(clp); | 159 | kfree(clp); |
168 | error_0: | 160 | error_0: |
169 | return NULL; | 161 | return NULL; |
@@ -207,6 +199,8 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp) | |||
207 | 199 | ||
208 | clp->cl_call_sync = _nfs4_call_sync; | 200 | clp->cl_call_sync = _nfs4_call_sync; |
209 | #endif /* CONFIG_NFS_V4_1 */ | 201 | #endif /* CONFIG_NFS_V4_1 */ |
202 | |||
203 | nfs4_destroy_callback(clp); | ||
210 | } | 204 | } |
211 | 205 | ||
212 | /* | 206 | /* |
@@ -225,8 +219,6 @@ static void nfs_free_client(struct nfs_client *clp) | |||
225 | if (!IS_ERR(clp->cl_rpcclient)) | 219 | if (!IS_ERR(clp->cl_rpcclient)) |
226 | rpc_shutdown_client(clp->cl_rpcclient); | 220 | rpc_shutdown_client(clp->cl_rpcclient); |
227 | 221 | ||
228 | nfs4_destroy_callback(clp); | ||
229 | |||
230 | if (clp->cl_machine_cred != NULL) | 222 | if (clp->cl_machine_cred != NULL) |
231 | put_rpccred(clp->cl_machine_cred); | 223 | put_rpccred(clp->cl_machine_cred); |
232 | 224 | ||
@@ -1104,7 +1096,8 @@ static int nfs4_init_callback(struct nfs_client *clp) | |||
1104 | int error; | 1096 | int error; |
1105 | 1097 | ||
1106 | if (clp->rpc_ops->version == 4) { | 1098 | if (clp->rpc_ops->version == 4) { |
1107 | error = nfs_callback_up(); | 1099 | error = nfs_callback_up(clp->cl_minorversion, |
1100 | clp->cl_rpcclient->cl_xprt); | ||
1108 | if (error < 0) { | 1101 | if (error < 0) { |
1109 | dprintk("%s: failed to start callback. Error = %d\n", | 1102 | dprintk("%s: failed to start callback. Error = %d\n", |
1110 | __func__, error); | 1103 | __func__, error); |
@@ -1139,7 +1132,7 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp) | |||
1139 | } | 1132 | } |
1140 | #endif /* CONFIG_NFS_V4_1 */ | 1133 | #endif /* CONFIG_NFS_V4_1 */ |
1141 | 1134 | ||
1142 | return 0; | 1135 | return nfs4_init_callback(clp); |
1143 | } | 1136 | } |
1144 | 1137 | ||
1145 | /* | 1138 | /* |