aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h39
1 files changed, 27 insertions, 12 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index f3b310e8ea03..78508f29c03a 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -2,6 +2,7 @@
2 * NFS internal definitions 2 * NFS internal definitions
3 */ 3 */
4 4
5#include "nfs4_fs.h"
5#include <linux/mount.h> 6#include <linux/mount.h>
6#include <linux/security.h> 7#include <linux/security.h>
7 8
@@ -17,6 +18,18 @@ struct nfs_string;
17 */ 18 */
18#define NFS_MAX_READAHEAD (RPC_DEF_SLOT_TABLE - 1) 19#define NFS_MAX_READAHEAD (RPC_DEF_SLOT_TABLE - 1)
19 20
21/*
22 * Determine if sessions are in use.
23 */
24static inline int nfs4_has_session(const struct nfs_client *clp)
25{
26#ifdef CONFIG_NFS_V4_1
27 if (clp->cl_session)
28 return 1;
29#endif /* CONFIG_NFS_V4_1 */
30 return 0;
31}
32
20struct nfs_clone_mount { 33struct nfs_clone_mount {
21 const struct super_block *sb; 34 const struct super_block *sb;
22 const struct dentry *dentry; 35 const struct dentry *dentry;
@@ -148,6 +161,20 @@ extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int);
148extern struct rpc_procinfo nfs3_procedures[]; 161extern struct rpc_procinfo nfs3_procedures[];
149extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int); 162extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int);
150 163
164/* nfs4proc.c */
165static inline void nfs4_restart_rpc(struct rpc_task *task,
166 const struct nfs_client *clp)
167{
168#ifdef CONFIG_NFS_V4_1
169 if (nfs4_has_session(clp) &&
170 test_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) {
171 rpc_restart_call_prepare(task);
172 return;
173 }
174#endif /* CONFIG_NFS_V4_1 */
175 rpc_restart_call(task);
176}
177
151/* nfs4xdr.c */ 178/* nfs4xdr.c */
152#ifdef CONFIG_NFS_V4 179#ifdef CONFIG_NFS_V4
153extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); 180extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
@@ -225,18 +252,6 @@ extern int _nfs4_call_sync_session(struct nfs_server *server,
225 struct nfs4_sequence_res *res, 252 struct nfs4_sequence_res *res,
226 int cache_reply); 253 int cache_reply);
227 254
228/*
229 * Determine if sessions are in use.
230 */
231static inline int nfs4_has_session(const struct nfs_client *clp)
232{
233#ifdef CONFIG_NFS_V4_1
234 if (clp->cl_session)
235 return 1;
236#endif /* CONFIG_NFS_V4_1 */
237 return 0;
238}
239
240#ifdef CONFIG_NFS_V4_1 255#ifdef CONFIG_NFS_V4_1
241extern void nfs41_sequence_free_slot(const struct nfs_client *, 256extern void nfs41_sequence_free_slot(const struct nfs_client *,
242 struct nfs4_sequence_res *res); 257 struct nfs4_sequence_res *res);