Commit cb04ad2a authored by Peng Tao's avatar Peng Tao Committed by Tom Haynes

nfs4: pass slot table to nfs40_setup_sequence

flexclient needs this as there is no nfs_server to DS connection.
Signed-off-by: default avatarPeng Tao <tao.peng@primarydata.com>
Signed-off-by: default avatarTom Haynes <Thomas.Haynes@primarydata.com>
parent c36aae9a
...@@ -443,6 +443,10 @@ extern void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid); ...@@ -443,6 +443,10 @@ extern void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid);
extern void nfs_increment_lock_seqid(int status, struct nfs_seqid *seqid); extern void nfs_increment_lock_seqid(int status, struct nfs_seqid *seqid);
extern void nfs_release_seqid(struct nfs_seqid *seqid); extern void nfs_release_seqid(struct nfs_seqid *seqid);
extern void nfs_free_seqid(struct nfs_seqid *seqid); extern void nfs_free_seqid(struct nfs_seqid *seqid);
extern int nfs40_setup_sequence(struct nfs4_slot_table *tbl,
struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res,
struct rpc_task *task);
extern void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp); extern void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp);
......
...@@ -495,12 +495,11 @@ static void nfs4_set_sequence_privileged(struct nfs4_sequence_args *args) ...@@ -495,12 +495,11 @@ static void nfs4_set_sequence_privileged(struct nfs4_sequence_args *args)
args->sa_privileged = 1; args->sa_privileged = 1;
} }
static int nfs40_setup_sequence(const struct nfs_server *server, int nfs40_setup_sequence(struct nfs4_slot_table *tbl,
struct nfs4_sequence_args *args, struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
struct rpc_task *task) struct rpc_task *task)
{ {
struct nfs4_slot_table *tbl = server->nfs_client->cl_slot_tbl;
struct nfs4_slot *slot; struct nfs4_slot *slot;
/* slot already allocated? */ /* slot already allocated? */
...@@ -535,6 +534,7 @@ static int nfs40_setup_sequence(const struct nfs_server *server, ...@@ -535,6 +534,7 @@ static int nfs40_setup_sequence(const struct nfs_server *server,
spin_unlock(&tbl->slot_tbl_lock); spin_unlock(&tbl->slot_tbl_lock);
return -EAGAIN; return -EAGAIN;
} }
EXPORT_SYMBOL_GPL(nfs40_setup_sequence);
static int nfs40_sequence_done(struct rpc_task *task, static int nfs40_sequence_done(struct rpc_task *task,
struct nfs4_sequence_res *res) struct nfs4_sequence_res *res)
...@@ -777,7 +777,8 @@ static int nfs4_setup_sequence(const struct nfs_server *server, ...@@ -777,7 +777,8 @@ static int nfs4_setup_sequence(const struct nfs_server *server,
int ret = 0; int ret = 0;
if (!session) if (!session)
return nfs40_setup_sequence(server, args, res, task); return nfs40_setup_sequence(server->nfs_client->cl_slot_tbl,
args, res, task);
dprintk("--> %s clp %p session %p sr_slot %u\n", dprintk("--> %s clp %p session %p sr_slot %u\n",
__func__, session->clp, session, res->sr_slot ? __func__, session->clp, session, res->sr_slot ?
...@@ -818,7 +819,8 @@ static int nfs4_setup_sequence(const struct nfs_server *server, ...@@ -818,7 +819,8 @@ static int nfs4_setup_sequence(const struct nfs_server *server,
struct nfs4_sequence_res *res, struct nfs4_sequence_res *res,
struct rpc_task *task) struct rpc_task *task)
{ {
return nfs40_setup_sequence(server, args, res, task); return nfs40_setup_sequence(server->nfs_client->cl_slot_tbl,
args, res, task);
} }
static int nfs4_sequence_done(struct rpc_task *task, static int nfs4_sequence_done(struct rpc_task *task,
...@@ -1679,8 +1681,8 @@ static void nfs4_open_confirm_prepare(struct rpc_task *task, void *calldata) ...@@ -1679,8 +1681,8 @@ static void nfs4_open_confirm_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs4_opendata *data = calldata; struct nfs4_opendata *data = calldata;
nfs40_setup_sequence(data->o_arg.server, &data->c_arg.seq_args, nfs40_setup_sequence(data->o_arg.server->nfs_client->cl_slot_tbl,
&data->c_res.seq_res, task); &data->c_arg.seq_args, &data->c_res.seq_res, task);
} }
static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata) static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata)
...@@ -5974,8 +5976,8 @@ static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata ...@@ -5974,8 +5976,8 @@ static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata
{ {
struct nfs_release_lockowner_data *data = calldata; struct nfs_release_lockowner_data *data = calldata;
struct nfs_server *server = data->server; struct nfs_server *server = data->server;
nfs40_setup_sequence(server, &data->args.seq_args, nfs40_setup_sequence(server->nfs_client->cl_slot_tbl,
&data->res.seq_res, task); &data->args.seq_args, &data->res.seq_res, task);
data->args.lock_owner.clientid = server->nfs_client->cl_clientid; data->args.lock_owner.clientid = server->nfs_client->cl_clientid;
data->timestamp = jiffies; data->timestamp = jiffies;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment