diff options
author | Andy Adamson <andros@netapp.com> | 2009-04-01 09:22:22 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 13:46:45 -0400 |
commit | 66179efee31f431ab538016b4ac05edaf87525dc (patch) | |
tree | e871bc165f8405bb4a00ed42023361bd8c5046c7 /fs/nfs | |
parent | d898528cdb338b145c71049c3cb7b1dfa542a48a (diff) |
nfs41: lock sequence setup/done support
Separate nfs4_lock calls from nfs41: sequence setup/done support
Call nfs4_sequence_done from respective rpc_call_done methods.
Note that we need to pass a pointer to the nfs_server in calls data
for passing on to nfs4_sequence_done.
Signed-off-by: Andy Adamson<andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[pnfs: client data server write validate and release]
[use nfs4_sequence_done_free_slot]
Signed-off-by: Andy Adamson<andros@umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 46e2509452a5..dc070819096a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3688,6 +3688,7 @@ struct nfs4_lockdata { | |||
3688 | unsigned long timestamp; | 3688 | unsigned long timestamp; |
3689 | int rpc_status; | 3689 | int rpc_status; |
3690 | int cancelled; | 3690 | int cancelled; |
3691 | struct nfs_server *server; | ||
3691 | }; | 3692 | }; |
3692 | 3693 | ||
3693 | static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl, | 3694 | static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl, |
@@ -3715,6 +3716,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl, | |||
3715 | p->res.lock_seqid = p->arg.lock_seqid; | 3716 | p->res.lock_seqid = p->arg.lock_seqid; |
3716 | p->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE; | 3717 | p->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE; |
3717 | p->lsp = lsp; | 3718 | p->lsp = lsp; |
3719 | p->server = server; | ||
3718 | atomic_inc(&lsp->ls_count); | 3720 | atomic_inc(&lsp->ls_count); |
3719 | p->ctx = get_nfs_open_context(ctx); | 3721 | p->ctx = get_nfs_open_context(ctx); |
3720 | memcpy(&p->fl, fl, sizeof(p->fl)); | 3722 | memcpy(&p->fl, fl, sizeof(p->fl)); |
@@ -3744,6 +3746,9 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata) | |||
3744 | } else | 3746 | } else |
3745 | data->arg.new_lock_owner = 0; | 3747 | data->arg.new_lock_owner = 0; |
3746 | data->timestamp = jiffies; | 3748 | data->timestamp = jiffies; |
3749 | if (nfs4_setup_sequence(data->server->nfs_client, &data->arg.seq_args, | ||
3750 | &data->res.seq_res, 1, task)) | ||
3751 | return; | ||
3747 | rpc_call_start(task); | 3752 | rpc_call_start(task); |
3748 | dprintk("%s: done!, ret = %d\n", __func__, data->rpc_status); | 3753 | dprintk("%s: done!, ret = %d\n", __func__, data->rpc_status); |
3749 | } | 3754 | } |
@@ -3754,6 +3759,9 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) | |||
3754 | 3759 | ||
3755 | dprintk("%s: begin!\n", __func__); | 3760 | dprintk("%s: begin!\n", __func__); |
3756 | 3761 | ||
3762 | nfs4_sequence_done_free_slot(data->server, &data->res.seq_res, | ||
3763 | task->tk_status); | ||
3764 | |||
3757 | data->rpc_status = task->tk_status; | 3765 | data->rpc_status = task->tk_status; |
3758 | if (RPC_ASSASSINATED(task)) | 3766 | if (RPC_ASSASSINATED(task)) |
3759 | goto out; | 3767 | goto out; |