diff options
Diffstat (limited to 'fs/nfs/internal.h')
| -rw-r--r-- | fs/nfs/internal.h | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index e21b1bb9972f..29e464d23b32 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
| @@ -30,6 +30,15 @@ static inline int nfs4_has_session(const struct nfs_client *clp) | |||
| 30 | return 0; | 30 | return 0; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | static inline int nfs4_has_persistent_session(const struct nfs_client *clp) | ||
| 34 | { | ||
| 35 | #ifdef CONFIG_NFS_V4_1 | ||
| 36 | if (nfs4_has_session(clp)) | ||
| 37 | return (clp->cl_session->flags & SESSION4_PERSIST); | ||
| 38 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 39 | return 0; | ||
| 40 | } | ||
| 41 | |||
| 33 | struct nfs_clone_mount { | 42 | struct nfs_clone_mount { |
| 34 | const struct super_block *sb; | 43 | const struct super_block *sb; |
| 35 | const struct dentry *dentry; | 44 | const struct dentry *dentry; |
| @@ -156,6 +165,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr | |||
| 156 | 165 | ||
| 157 | /* callback_xdr.c */ | 166 | /* callback_xdr.c */ |
| 158 | extern struct svc_version nfs4_callback_version1; | 167 | extern struct svc_version nfs4_callback_version1; |
| 168 | extern struct svc_version nfs4_callback_version4; | ||
| 159 | 169 | ||
| 160 | /* pagelist.c */ | 170 | /* pagelist.c */ |
| 161 | extern int __init nfs_init_nfspagecache(void); | 171 | extern int __init nfs_init_nfspagecache(void); |
| @@ -177,24 +187,14 @@ extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int); | |||
| 177 | extern struct rpc_procinfo nfs3_procedures[]; | 187 | extern struct rpc_procinfo nfs3_procedures[]; |
| 178 | extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int); | 188 | extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int); |
| 179 | 189 | ||
| 180 | /* nfs4proc.c */ | ||
| 181 | static inline void nfs4_restart_rpc(struct rpc_task *task, | ||
| 182 | const struct nfs_client *clp) | ||
| 183 | { | ||
| 184 | #ifdef CONFIG_NFS_V4_1 | ||
| 185 | if (nfs4_has_session(clp) && | ||
| 186 | test_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) { | ||
| 187 | rpc_restart_call_prepare(task); | ||
| 188 | return; | ||
| 189 | } | ||
| 190 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 191 | rpc_restart_call(task); | ||
| 192 | } | ||
| 193 | |||
| 194 | /* nfs4xdr.c */ | 190 | /* nfs4xdr.c */ |
| 195 | #ifdef CONFIG_NFS_V4 | 191 | #ifdef CONFIG_NFS_V4 |
| 196 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); | 192 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); |
| 197 | #endif | 193 | #endif |
| 194 | #ifdef CONFIG_NFS_V4_1 | ||
| 195 | extern const u32 nfs41_maxread_overhead; | ||
| 196 | extern const u32 nfs41_maxwrite_overhead; | ||
| 197 | #endif | ||
| 198 | 198 | ||
| 199 | /* nfs4proc.c */ | 199 | /* nfs4proc.c */ |
| 200 | #ifdef CONFIG_NFS_V4 | 200 | #ifdef CONFIG_NFS_V4 |
| @@ -273,20 +273,6 @@ extern int _nfs4_call_sync_session(struct nfs_server *server, | |||
| 273 | struct nfs4_sequence_res *res, | 273 | struct nfs4_sequence_res *res, |
| 274 | int cache_reply); | 274 | int cache_reply); |
| 275 | 275 | ||
| 276 | #ifdef CONFIG_NFS_V4_1 | ||
| 277 | extern void nfs41_sequence_free_slot(const struct nfs_client *, | ||
| 278 | struct nfs4_sequence_res *res); | ||
| 279 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 280 | |||
| 281 | static inline void nfs4_sequence_free_slot(const struct nfs_client *clp, | ||
| 282 | struct nfs4_sequence_res *res) | ||
| 283 | { | ||
| 284 | #ifdef CONFIG_NFS_V4_1 | ||
| 285 | if (nfs4_has_session(clp)) | ||
| 286 | nfs41_sequence_free_slot(clp, res); | ||
| 287 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 288 | } | ||
| 289 | |||
| 290 | /* | 276 | /* |
| 291 | * Determine the device name as a string | 277 | * Determine the device name as a string |
| 292 | */ | 278 | */ |
| @@ -380,3 +366,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) | |||
| 380 | return ((unsigned long)len + (unsigned long)base + | 366 | return ((unsigned long)len + (unsigned long)base + |
| 381 | PAGE_SIZE - 1) >> PAGE_SHIFT; | 367 | PAGE_SIZE - 1) >> PAGE_SHIFT; |
| 382 | } | 368 | } |
| 369 | |||
| 370 | /* | ||
| 371 | * Helper for restarting RPC calls in the possible presence of NFSv4.1 | ||
| 372 | * sessions. | ||
| 373 | */ | ||
| 374 | static inline void nfs_restart_rpc(struct rpc_task *task, const struct nfs_client *clp) | ||
| 375 | { | ||
| 376 | if (nfs4_has_session(clp)) | ||
| 377 | rpc_restart_call_prepare(task); | ||
| 378 | else | ||
| 379 | rpc_restart_call(task); | ||
| 380 | } | ||
