aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-02-28 20:34:17 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:42 -0500
commitd83217c13531fd59730d77b5c2284e90e56c0a50 (patch)
treee347037afc91fdb81e0e2fcf7225d30462fb90af /fs/nfs/nfs4proc.c
parent64419a9b20938d9070fdd8c58c2fa23c911915f8 (diff)
NFSv4.1: data server connection
Introduce a data server set_client and init session following the nfs4_set_client and nfs4_init_session convention. Once a new nfs_client is on the nfs_client_list, the nfs_client cl_cons_state serializes access to creating an nfs_client struct with matching properties. Use the new nfs_get_client() that initializes new clients. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 55a8fc2f3df4..07d1a43f40f5 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1573,9 +1573,8 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
1573 return 0; 1573 return 0;
1574} 1574}
1575 1575
1576static int nfs4_recover_expired_lease(struct nfs_server *server) 1576static int nfs4_client_recover_expired_lease(struct nfs_client *clp)
1577{ 1577{
1578 struct nfs_client *clp = server->nfs_client;
1579 unsigned int loop; 1578 unsigned int loop;
1580 int ret; 1579 int ret;
1581 1580
@@ -1592,6 +1591,11 @@ static int nfs4_recover_expired_lease(struct nfs_server *server)
1592 return ret; 1591 return ret;
1593} 1592}
1594 1593
1594static int nfs4_recover_expired_lease(struct nfs_server *server)
1595{
1596 return nfs4_client_recover_expired_lease(server->nfs_client);
1597}
1598
1595/* 1599/*
1596 * OPEN_EXPIRED: 1600 * OPEN_EXPIRED:
1597 * reclaim state on the server after a network partition. 1601 * reclaim state on the server after a network partition.
@@ -5118,6 +5122,27 @@ int nfs4_init_session(struct nfs_server *server)
5118 return ret; 5122 return ret;
5119} 5123}
5120 5124
5125int nfs4_init_ds_session(struct nfs_client *clp)
5126{
5127 struct nfs4_session *session = clp->cl_session;
5128 int ret;
5129
5130 if (!test_and_clear_bit(NFS4_SESSION_INITING, &session->session_state))
5131 return 0;
5132
5133 ret = nfs4_client_recover_expired_lease(clp);
5134 if (!ret)
5135 /* Test for the DS role */
5136 if (!is_ds_client(clp))
5137 ret = -ENODEV;
5138 if (!ret)
5139 ret = nfs4_check_client_ready(clp);
5140 return ret;
5141
5142}
5143EXPORT_SYMBOL_GPL(nfs4_init_ds_session);
5144
5145
5121/* 5146/*
5122 * Renew the cl_session lease. 5147 * Renew the cl_session lease.
5123 */ 5148 */