]> err.no Git - linux-2.6/blobdiff - fs/nfs/nfs4proc.c
NFSv4: Remove bogus call to nfs4_drop_state_owner() in _nfs4_open_expired()
[linux-2.6] / fs / nfs / nfs4proc.c
index 027e1095256ebe09cb001d1736489a7216620d0d..424aa206470f4b3d575229fbfe9ce4fd5ab2bbd0 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "nfs4_fs.h"
 #include "delegation.h"
+#include "internal.h"
 #include "iostat.h"
 
 #define NFSDBG_FACILITY                NFSDBG_PROC
@@ -773,6 +774,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
                .rpc_message = &msg,
                .callback_ops = &nfs4_open_confirm_ops,
                .callback_data = data,
+               .workqueue = nfsiod_workqueue,
                .flags = RPC_TASK_ASYNC,
        };
        int status;
@@ -910,6 +912,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
                .rpc_message = &msg,
                .callback_ops = &nfs4_open_ops,
                .callback_data = data,
+               .workqueue = nfsiod_workqueue,
                .flags = RPC_TASK_ASYNC,
        };
        int status;
@@ -979,11 +982,8 @@ static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *s
        if (IS_ERR(opendata))
                return PTR_ERR(opendata);
        ret = nfs4_open_recover(opendata, state);
-       if (ret == -ESTALE) {
-               /* Invalidate the state owner so we don't ever use it again */
-               nfs4_drop_state_owner(state->owner);
+       if (ret == -ESTALE)
                d_drop(ctx->path.dentry);
-       }
        nfs4_opendata_put(opendata);
        return ret;
 }
@@ -1315,6 +1315,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait)
                .rpc_client = server->client,
                .rpc_message = &msg,
                .callback_ops = &nfs4_close_ops,
+               .workqueue = nfsiod_workqueue,
                .flags = RPC_TASK_ASYNC,
        };
        int status = -ENOMEM;
@@ -1384,11 +1385,11 @@ out_close:
 struct dentry *
 nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
 {
-       struct dentry *parent;
        struct path path = {
-               .mnt = nd->mnt,
+               .mnt = nd->path.mnt,
                .dentry = dentry,
        };
+       struct dentry *parent;
        struct iattr attr;
        struct rpc_cred *cred;
        struct nfs4_state *state;
@@ -1404,7 +1405,7 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
                BUG_ON(nd->intent.open.flags & O_CREAT);
        }
 
-       cred = rpcauth_lookupcred(NFS_CLIENT(dir)->cl_auth, 0);
+       cred = rpc_lookup_cred();
        if (IS_ERR(cred))
                return (struct dentry *)cred;
        parent = dentry->d_parent;
@@ -1433,13 +1434,13 @@ int
 nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, struct nameidata *nd)
 {
        struct path path = {
-               .mnt = nd->mnt,
+               .mnt = nd->path.mnt,
                .dentry = dentry,
        };
        struct rpc_cred *cred;
        struct nfs4_state *state;
 
-       cred = rpcauth_lookupcred(NFS_CLIENT(dir)->cl_auth, 0);
+       cred = rpc_lookup_cred();
        if (IS_ERR(cred))
                return PTR_ERR(cred);
        state = nfs4_do_open(dir, &path, openflags, NULL, cred);
@@ -1656,7 +1657,7 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
 
        nfs_fattr_init(fattr);
        
-       cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
+       cred = rpc_lookup_cred();
        if (IS_ERR(cred))
                return PTR_ERR(cred);
 
@@ -1885,14 +1886,14 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
                  int flags, struct nameidata *nd)
 {
        struct path path = {
-               .mnt = nd->mnt,
+               .mnt = nd->path.mnt,
                .dentry = dentry,
        };
        struct nfs4_state *state;
        struct rpc_cred *cred;
        int status = 0;
 
-       cred = rpcauth_lookupcred(NFS_CLIENT(dir)->cl_auth, 0);
+       cred = rpc_lookup_cred();
        if (IS_ERR(cred)) {
                status = PTR_ERR(cred);
                goto out;
@@ -2761,10 +2762,10 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server)
                case -NFS4ERR_STALE_CLIENTID:
                case -NFS4ERR_STALE_STATEID:
                case -NFS4ERR_EXPIRED:
-                       rpc_sleep_on(&clp->cl_rpcwaitq, task, NULL, NULL);
+                       rpc_sleep_on(&clp->cl_rpcwaitq, task, NULL);
                        nfs4_schedule_state_recovery(clp);
                        if (test_bit(NFS4CLNT_STATE_RECOVER, &clp->cl_state) == 0)
-                               rpc_wake_up_task(task);
+                               rpc_wake_up_queued_task(&clp->cl_rpcwaitq, task);
                        task->tk_status = 0;
                        return -EAGAIN;
                case -NFS4ERR_DELAY:
@@ -3235,6 +3236,7 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
                .rpc_client = NFS_CLIENT(lsp->ls_state->inode),
                .rpc_message = &msg,
                .callback_ops = &nfs4_locku_ops,
+               .workqueue = nfsiod_workqueue,
                .flags = RPC_TASK_ASYNC,
        };
 
@@ -3419,6 +3421,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
                .rpc_client = NFS_CLIENT(state->inode),
                .rpc_message = &msg,
                .callback_ops = &nfs4_lock_ops,
+               .workqueue = nfsiod_workqueue,
                .flags = RPC_TASK_ASYNC,
        };
        int ret;