Commit 75575ddf authored by Jeff Layton's avatar Jeff Layton Committed by Anna Schumaker

nfs: eliminate pointless and confusing do_vfs_lock wrappers

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent b60475c9
...@@ -710,11 +710,6 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) ...@@ -710,11 +710,6 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
goto out; goto out;
} }
static int do_vfs_lock(struct file *file, struct file_lock *fl)
{
return locks_lock_file_wait(file, fl);
}
static int static int
do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
{ {
...@@ -747,7 +742,7 @@ do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) ...@@ -747,7 +742,7 @@ do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
if (!is_local) if (!is_local)
status = NFS_PROTO(inode)->lock(filp, cmd, fl); status = NFS_PROTO(inode)->lock(filp, cmd, fl);
else else
status = do_vfs_lock(filp, fl); status = locks_lock_file_wait(filp, fl);
return status; return status;
} }
...@@ -772,7 +767,7 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) ...@@ -772,7 +767,7 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
if (!is_local) if (!is_local)
status = NFS_PROTO(inode)->lock(filp, cmd, fl); status = NFS_PROTO(inode)->lock(filp, cmd, fl);
else else
status = do_vfs_lock(filp, fl); status = locks_lock_file_wait(filp, fl);
if (status < 0) if (status < 0)
goto out; goto out;
......
...@@ -5600,11 +5600,6 @@ static int nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock * ...@@ -5600,11 +5600,6 @@ static int nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock *
return err; return err;
} }
static int do_vfs_lock(struct inode *inode, struct file_lock *fl)
{
return locks_lock_inode_wait(inode, fl);
}
struct nfs4_unlockdata { struct nfs4_unlockdata {
struct nfs_locku_args arg; struct nfs_locku_args arg;
struct nfs_locku_res res; struct nfs_locku_res res;
...@@ -5657,7 +5652,7 @@ static void nfs4_locku_done(struct rpc_task *task, void *data) ...@@ -5657,7 +5652,7 @@ static void nfs4_locku_done(struct rpc_task *task, void *data)
switch (task->tk_status) { switch (task->tk_status) {
case 0: case 0:
renew_lease(calldata->server, calldata->timestamp); renew_lease(calldata->server, calldata->timestamp);
do_vfs_lock(calldata->lsp->ls_state->inode, &calldata->fl); locks_lock_inode_wait(calldata->lsp->ls_state->inode, &calldata->fl);
if (nfs4_update_lock_stateid(calldata->lsp, if (nfs4_update_lock_stateid(calldata->lsp,
&calldata->res.stateid)) &calldata->res.stateid))
break; break;
...@@ -5765,7 +5760,7 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock * ...@@ -5765,7 +5760,7 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
mutex_lock(&sp->so_delegreturn_mutex); mutex_lock(&sp->so_delegreturn_mutex);
/* Exclude nfs4_reclaim_open_stateid() - note nesting! */ /* Exclude nfs4_reclaim_open_stateid() - note nesting! */
down_read(&nfsi->rwsem); down_read(&nfsi->rwsem);
if (do_vfs_lock(inode, request) == -ENOENT) { if (locks_lock_inode_wait(inode, request) == -ENOENT) {
up_read(&nfsi->rwsem); up_read(&nfsi->rwsem);
mutex_unlock(&sp->so_delegreturn_mutex); mutex_unlock(&sp->so_delegreturn_mutex);
goto out; goto out;
...@@ -5906,7 +5901,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) ...@@ -5906,7 +5901,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
data->timestamp); data->timestamp);
if (data->arg.new_lock) { if (data->arg.new_lock) {
data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS); data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
if (do_vfs_lock(lsp->ls_state->inode, &data->fl) < 0) { if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0) {
rpc_restart_call_prepare(task); rpc_restart_call_prepare(task);
break; break;
} }
...@@ -6148,7 +6143,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock ...@@ -6148,7 +6143,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
if (status != 0) if (status != 0)
goto out; goto out;
request->fl_flags |= FL_ACCESS; request->fl_flags |= FL_ACCESS;
status = do_vfs_lock(state->inode, request); status = locks_lock_inode_wait(state->inode, request);
if (status < 0) if (status < 0)
goto out; goto out;
mutex_lock(&sp->so_delegreturn_mutex); mutex_lock(&sp->so_delegreturn_mutex);
...@@ -6157,7 +6152,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock ...@@ -6157,7 +6152,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock
/* Yes: cache locks! */ /* Yes: cache locks! */
/* ...but avoid races with delegation recall... */ /* ...but avoid races with delegation recall... */
request->fl_flags = fl_flags & ~FL_SLEEP; request->fl_flags = fl_flags & ~FL_SLEEP;
status = do_vfs_lock(state->inode, request); status = locks_lock_inode_wait(state->inode, request);
up_read(&nfsi->rwsem); up_read(&nfsi->rwsem);
mutex_unlock(&sp->so_delegreturn_mutex); mutex_unlock(&sp->so_delegreturn_mutex);
goto out; goto out;
......
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