do_renew_lease(clp, timestamp);
}
-void nfs4_init_sequence(struct nfs4_sequence_args *args,
+void nfs4_init_sequence(struct nfs_client *clp,
+ struct nfs4_sequence_args *args,
struct nfs4_sequence_res *res, int cache_reply,
int privileged)
{
struct nfs4_sequence_res *res,
int cache_reply)
{
- nfs4_init_sequence(args, res, cache_reply, 0);
+ nfs4_init_sequence(server->nfs_client, args, res, cache_reply, 0);
return nfs4_call_sync_sequence(clnt, server, msg, args, res);
}
};
int status;
- nfs4_init_sequence(&data->c_arg.seq_args, &data->c_res.seq_res, 1,
- data->is_recover);
+ nfs4_init_sequence(server->nfs_client, &data->c_arg.seq_args,
+ &data->c_res.seq_res, 1, data->is_recover);
kref_get(&data->kref);
data->rpc_done = false;
data->rpc_status = 0;
{
struct inode *dir = d_inode(data->dir);
struct nfs_server *server = NFS_SERVER(dir);
+ struct nfs_client *clp = server->nfs_client;
struct nfs_openargs *o_arg = &data->o_arg;
struct nfs_openres *o_res = &data->o_res;
struct rpc_task *task;
data->cancelled = false;
data->is_recover = false;
if (!ctx) {
- nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 1);
+ nfs4_init_sequence(clp, &o_arg->seq_args, &o_res->seq_res, 1, 1);
data->is_recover = true;
task_setup_data.flags |= RPC_TASK_TIMEOUT;
} else {
- nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 0);
+ nfs4_init_sequence(clp, &o_arg->seq_args, &o_res->seq_res, 1, 0);
pnfs_lgopen_prepare(data, ctx);
}
task = rpc_run_task(&task_setup_data);
int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait)
{
struct nfs_server *server = NFS_SERVER(state->inode);
+ struct nfs_client *clp = server->nfs_client;
struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
struct nfs4_closedata *calldata;
struct nfs4_state_owner *sp = state->owner;
if (nfs_server_capable(state->inode, NFS_CAP_MOVEABLE))
task_setup_data.flags |= RPC_TASK_MOVEABLE;
- nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_CLEANUP,
+ nfs4_state_protect(clp, NFS_SP4_MACH_CRED_CLEANUP,
&task_setup_data.rpc_client, &msg);
calldata = kzalloc(sizeof(*calldata), gfp_mask);
if (calldata == NULL)
goto out;
- nfs4_init_sequence(&calldata->arg.seq_args, &calldata->res.seq_res, 1, 0);
+ nfs4_init_sequence(clp, &calldata->arg.seq_args,
+ &calldata->res.seq_res, 1, 0);
calldata->inode = state->inode;
calldata->state = state;
calldata->arg.fh = NFS_FH(state->inode);
if (!nfs4_copy_open_stateid(&calldata->arg.stateid, state))
goto out_free_calldata;
/* Serialization for the sequence id */
- alloc_seqid = server->nfs_client->cl_mvops->alloc_seqid;
+ alloc_seqid = clp->cl_mvops->alloc_seqid;
calldata->arg.seqid = alloc_seqid(&state->owner->so_seqid, gfp_mask);
if (IS_ERR(calldata->arg.seqid))
goto out_free_calldata;
.callback_ops = &nfs4_call_getattr_ops,
.callback_data = &data,
};
+ struct nfs_client *clp = server->nfs_client;
struct nfs4_gdd_res gdd_res;
int status;
- if (nfs4_has_session(server->nfs_client))
+ if (nfs4_has_session(clp))
task_setup.flags = RPC_TASK_MOVEABLE;
/* Is this is an attribute revalidation, subject to softreval? */
nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, fattr->label), inode, 0);
nfs_fattr_init(fattr);
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+ nfs4_init_sequence(clp, &args.seq_args, &res.seq_res, 0, 0);
status = nfs4_call_sync_custom(&task_setup);
nfs_fattr_init(fattr);
dprintk("NFS call lookup %pd2\n", dentry);
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+ nfs4_init_sequence(server->nfs_client, &args.seq_args, &res.seq_res, 0, 0);
status = nfs4_do_call_sync(clnt, server, &msg,
&args.seq_args, &res.seq_res, task_flags);
dprintk("NFS reply lookup: %d\n", status);
args.bitmask = nfs4_bitmask(server, fattr->label);
nfs_fattr_init(fattr);
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+ nfs4_init_sequence(server->nfs_client, &args.seq_args, &res.seq_res, 0, 0);
dprintk("NFS call lookupp ino=0x%lx\n", inode->i_ino);
status = nfs4_do_call_sync(clnt, server, &msg, &args.seq_args,
{
struct nfs_removeargs *args = msg->rpc_argp;
struct nfs_removeres *res = msg->rpc_resp;
+ struct nfs_server *server = NFS_SB(dentry->d_sb);
- res->server = NFS_SB(dentry->d_sb);
+ res->server = server;
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE];
- nfs4_init_sequence(&args->seq_args, &res->seq_res, 1, 0);
+ nfs4_init_sequence(server->nfs_client, &args->seq_args,
+ &res->seq_res, 1, 0);
nfs_fattr_init(res->dir_attr);
nfs_request_directory_delegation(d_inode(dentry->d_parent));
struct dentry *new_dentry,
struct inode *same_parent)
{
+ struct nfs_server *server = NFS_SB(old_dentry->d_sb);
struct nfs_renameargs *arg = msg->rpc_argp;
struct nfs_renameres *res = msg->rpc_resp;
struct inode *old_inode = d_inode(old_dentry);
if (same_parent)
nfs_request_directory_delegation(same_parent);
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME];
- res->server = NFS_SB(old_dentry->d_sb);
- nfs4_init_sequence(&arg->seq_args, &res->seq_res, 1, 0);
+ res->server = server,
+ nfs4_init_sequence(server->nfs_client, &arg->seq_args,
+ &res->seq_res, 1, 0);
}
static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
hdr->pgio_done_cb = nfs4_read_done_cb;
if (!nfs42_read_plus_support(hdr, msg))
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ];
- nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
+ nfs4_init_sequence(NFS_SERVER(hdr->inode)->nfs_client,
+ &hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
}
static int nfs4_proc_pgio_rpc_prepare(struct rpc_task *task,
hdr->timestamp = jiffies;
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
- nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
+ nfs4_init_sequence(server->nfs_client, &hdr->args.seq_args,
+ &hdr->res.seq_res, 0, 0);
nfs4_state_protect_write(hdr->ds_clp ? hdr->ds_clp : server->nfs_client, clnt, msg, hdr);
}
data->commit_done_cb = nfs4_commit_done_cb;
data->res.server = server;
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
- nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0);
+ nfs4_init_sequence(server->nfs_client, &data->args.seq_args,
+ &data->res.seq_res, 1, 0);
nfs4_state_protect(data->ds_clp ? data->ds_clp : server->nfs_client,
NFS_SP4_MACH_CRED_COMMIT, clnt, msg);
}
data->res.sattr_res = true;
}
- if (!data->inode)
- nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1,
- 1);
- else
- nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1,
- 0);
+ nfs4_init_sequence(server->nfs_client, &data->args.seq_args,
+ &data->res.seq_res, 1, !data->inode ? 1 : 0);
task_setup_data.callback_data = data;
msg.rpc_argp = &data->args;
struct nfs_seqid *seqid)
{
struct nfs4_unlockdata *data;
+ struct nfs_client *clp = NFS_SERVER(lsp->ls_state->inode)->nfs_client;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCKU],
.rpc_cred = ctx->cred,
if (nfs_server_capable(lsp->ls_state->inode, NFS_CAP_MOVEABLE))
task_setup_data.flags |= RPC_TASK_MOVEABLE;
- nfs4_state_protect(NFS_SERVER(lsp->ls_state->inode)->nfs_client,
- NFS_SP4_MACH_CRED_CLEANUP, &task_setup_data.rpc_client, &msg);
+ nfs4_state_protect(clp, NFS_SP4_MACH_CRED_CLEANUP,
+ &task_setup_data.rpc_client, &msg);
/* Ensure this is an unlock - when canceling a lock, the
* canceled lock is passed in, and it won't be an unlock.
return ERR_PTR(-ENOMEM);
}
- nfs4_init_sequence(&data->arg.seq_args, &data->res.seq_res, 1, 0);
+ nfs4_init_sequence(clp, &data->arg.seq_args, &data->res.seq_res, 1, 0);
msg.rpc_argp = &data->arg;
msg.rpc_resp = &data->res;
task_setup_data.callback_data = data;
{
struct nfs4_lockdata *data;
struct rpc_task *task;
+ struct nfs_client *clp = NFS_SERVER(state->inode)->nfs_client;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LOCK],
.rpc_cred = state->owner->so_cred,
return -ENOMEM;
if (IS_SETLKW(cmd))
data->arg.block = 1;
- nfs4_init_sequence(&data->arg.seq_args, &data->res.seq_res, 1,
+ nfs4_init_sequence(clp, &data->arg.seq_args, &data->res.seq_res, 1,
recovery_type > NFS_LOCK_NEW);
msg.rpc_argp = &data->arg;
msg.rpc_resp = &data->res;
struct page *page, const struct cred *cred)
{
struct rpc_clnt *clnt = server->client;
+ struct nfs_client *clp = server->nfs_client;
u32 bitmask[2] = {
[0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS,
};
struct rpc_task_setup task_setup_data = {
.rpc_client = clnt,
.rpc_message = &msg,
- .callback_ops = server->nfs_client->cl_mvops->call_sync_ops,
+ .callback_ops = clp->cl_mvops->call_sync_ops,
.callback_data = &data,
.flags = RPC_TASK_NO_ROUND_ROBIN,
};
locations->server = server;
locations->nlocations = 0;
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 1);
+ nfs4_init_sequence(clp, &args.seq_args, &res.seq_res, 0, 1);
status = nfs4_call_sync_custom(&task_setup_data);
if (status == NFS4_OK &&
res.seq_res.sr_status_flags & SEQ4_STATUS_LEASE_MOVED)
if (res.fh == NULL)
return -ENOMEM;
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 1);
+ nfs4_init_sequence(server->nfs_client, &args.seq_args, &res.seq_res, 0, 1);
status = nfs4_call_sync_sequence(clnt, server, &msg,
&args.seq_args, &res.seq_res);
nfs_free_fhandle(res.fh);
dprintk("NFS call secinfo %s\n", name->name);
nfs4_state_protect(clp, NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg);
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+ nfs4_init_sequence(clp, &args.seq_args, &res.seq_res, 0, 0);
status = nfs4_call_sync_custom(&task_setup);
dprintk("NFS reply secinfo: %d\n", status);
.flags = RPC_TASK_TIMEOUT,
};
- nfs4_init_sequence(&args.la_seq_args, &res.lr_seq_res, 0, 1);
+ nfs4_init_sequence(clp, &args.la_seq_args, &res.lr_seq_res, 0, 1);
return nfs4_call_sync_custom(&task_setup);
}
calldata = kzalloc(sizeof(*calldata), GFP_KERNEL);
if (calldata == NULL)
goto out_put_clp;
- nfs4_init_sequence(&calldata->args, &calldata->res, 0, is_privileged);
+ nfs4_init_sequence(clp, &calldata->args, &calldata->res, 0, is_privileged);
nfs4_sequence_attach_slot(&calldata->args, &calldata->res, slot);
msg.rpc_argp = &calldata->args;
msg.rpc_resp = &calldata->res;
calldata->clp = clp;
calldata->arg.one_fs = 0;
- nfs4_init_sequence(&calldata->arg.seq_args, &calldata->res.seq_res, 0, 1);
+ nfs4_init_sequence(clp, &calldata->arg.seq_args, &calldata->res.seq_res, 0, 1);
msg.rpc_argp = &calldata->arg;
msg.rpc_resp = &calldata->res;
task_setup_data.callback_data = calldata;
struct pnfs_layout_segment *lseg = NULL;
int status = 0;
- nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0, 0);
+ nfs4_init_sequence(server->nfs_client, &lgp->args.seq_args,
+ &lgp->res.seq_res, 0, 0);
exception->retry = 0;
task = rpc_run_task(&task_setup_data);
int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, unsigned int flags)
{
+ struct nfs_client *clp = NFS_SERVER(lrp->args.inode)->nfs_client;
struct rpc_task *task;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTRETURN],
};
int status = 0;
- nfs4_state_protect(NFS_SERVER(lrp->args.inode)->nfs_client,
- NFS_SP4_MACH_CRED_PNFS_CLEANUP,
- &task_setup_data.rpc_client, &msg);
+ nfs4_state_protect(clp, NFS_SP4_MACH_CRED_PNFS_CLEANUP,
+ &task_setup_data.rpc_client, &msg);
lrp->inode = nfs_igrab_and_active(lrp->args.inode);
if (flags & PNFS_FL_LAYOUTRETURN_ASYNC) {
}
if (!lrp->inode)
flags |= PNFS_FL_LAYOUTRETURN_PRIVILEGED;
- if (flags & PNFS_FL_LAYOUTRETURN_PRIVILEGED)
- nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1,
- 1);
- else
- nfs4_init_sequence(&lrp->args.seq_args, &lrp->res.seq_res, 1,
- 0);
+
+ nfs4_init_sequence(clp, &lrp->args.seq_args, &lrp->res.seq_res, 1,
+ flags & PNFS_FL_LAYOUTRETURN_PRIVILEGED ? 1 : 0);
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);
}
task_setup_data.flags = RPC_TASK_ASYNC;
}
- nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0);
+ nfs4_init_sequence(NFS_SERVER(data->args.inode)->nfs_client,
+ &data->args.seq_args, &data->res.seq_res, 1, 0);
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);
struct nfs4_secinfo_flavors *flavors,
bool use_integrity)
{
+ struct nfs_client *clp = server->nfs_client;
struct nfs41_secinfo_no_name_args args = {
.style = SECINFO_STYLE_CURRENT_FH,
};
struct rpc_task_setup task_setup = {
.rpc_client = server->client,
.rpc_message = &msg,
- .callback_ops = server->nfs_client->cl_mvops->call_sync_ops,
+ .callback_ops = clp->cl_mvops->call_sync_ops,
.callback_data = &data,
.flags = RPC_TASK_NO_ROUND_ROBIN,
};
int status;
if (use_integrity) {
- task_setup.rpc_client = server->nfs_client->cl_rpcclient;
+ task_setup.rpc_client = clp->cl_rpcclient;
- cred = nfs4_get_clid_cred(server->nfs_client);
+ cred = nfs4_get_clid_cred(clp);
msg.rpc_cred = cred;
}
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+ nfs4_init_sequence(clp, &args.seq_args, &res.seq_res, 0, 0);
status = nfs4_call_sync_custom(&task_setup);
dprintk("<-- %s status=%d\n", __func__, status);
.rpc_cred = cred,
};
struct rpc_clnt *rpc_client = server->client;
+ struct nfs_client *clp = server->nfs_client;
- nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_STATEID,
- &rpc_client, &msg);
+ nfs4_state_protect(clp, NFS_SP4_MACH_CRED_STATEID, &rpc_client, &msg);
dprintk("NFS call test_stateid %p\n", stateid);
- nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 1);
+ nfs4_init_sequence(clp, &args.seq_args, &res.seq_res, 0, 1);
status = nfs4_call_sync_sequence(rpc_client, server, &msg,
&args.seq_args, &res.seq_res);
if (status != NFS_OK) {
if (!refcount_inc_not_zero(&clp->cl_count))
return -EIO;
- nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_STATEID,
+ nfs4_state_protect(clp, NFS_SP4_MACH_CRED_STATEID,
&task_setup.rpc_client, &msg);
dprintk("NFS call free_stateid %p\n", stateid);
msg.rpc_argp = &data->args;
msg.rpc_resp = &data->res;
- nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, privileged);
+ nfs4_init_sequence(clp, &data->args.seq_args, &data->res.seq_res, 1,
+ privileged);
task = rpc_run_task(&task_setup);
if (IS_ERR(task))
return PTR_ERR(task);