[pnfs] [PATCH 02/11] nfs41: define nfs41_{set, test}_session_expired in header file
Benny Halevy
bhalevy at panasas.com
Sun Jan 20 09:15:31 EST 2008
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
fs/nfs/nfs41_session_recovery.c | 23 -----------------------
include/linux/nfs41_session_recovery.h | 23 +++++++++++++++++++++--
2 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/fs/nfs/nfs41_session_recovery.c b/fs/nfs/nfs41_session_recovery.c
index 78564ac..506acf8 100644
--- a/fs/nfs/nfs41_session_recovery.c
+++ b/fs/nfs/nfs41_session_recovery.c
@@ -26,29 +26,6 @@
#define NFSDBG_FACILITY NFSDBG_PROC
/*
- * Session state bits
- */
-enum nfs41_session_state {
- NFS41_SESSION_EXPIRED = 0,
- NFS41_SESSION_RECOVER,
-};
-
-/*
- * Set the session state expired
- */
-int nfs41_set_session_expired(struct nfs4_session *session)
-{
- set_bit(NFS41_SESSION_EXPIRED, &session->session_state);
-
- return 0;
-}
-
-int nfs41_test_session_expired(struct nfs4_session *session)
-{
- return test_bit(NFS41_SESSION_EXPIRED, &session->session_state);
-}
-
-/*
* Set the session state == valid. Returns previous value of the session state
*/
int nfs41_set_session_valid(struct nfs4_session *session)
diff --git a/include/linux/nfs41_session_recovery.h b/include/linux/nfs41_session_recovery.h
index dee5b19..afbac30 100644
--- a/include/linux/nfs41_session_recovery.h
+++ b/include/linux/nfs41_session_recovery.h
@@ -11,13 +11,32 @@
#if defined(CONFIG_NFS_V4_1)
-int nfs41_set_session_expired(struct nfs4_session *);
+/*
+ * Session state bits
+ */
+enum nfs41_session_state {
+ NFS41_SESSION_EXPIRED = 0,
+ NFS41_SESSION_RECOVER,
+};
+
+/*
+ * Set the session state expired
+ */
+static inline int nfs41_set_session_expired(struct nfs4_session *session)
+{
+ return test_and_set_bit(NFS41_SESSION_EXPIRED, &session->session_state);
+}
+
+static inline int nfs41_test_session_expired(struct nfs4_session *session)
+{
+ return test_bit(NFS41_SESSION_EXPIRED, &session->session_state);
+}
+
int nfs41_set_session_valid(struct nfs4_session *);
int nfs41_recover_session(struct nfs_client *, struct nfs4_session *);
int nfs41_recover_session_sync(struct rpc_clnt *, struct nfs_client *, struct nfs4_session *);
int nfs41_recover_session_async(struct rpc_task *, struct nfs_server *);
int nfs41_recover_expired_session(struct rpc_task *, struct nfs_client *, struct nfs4_session *);
-int nfs41_test_session_expired(struct nfs4_session *);
#endif /* CONFIG_NFS_V4_1 */
#endif /* __NFS41_SESSION_RECOVERY_H__ */
--
1.5.3.3
More information about the pNFS
mailing list