]> git.hungrycats.org Git - linux/commitdiff
[PATCH] A basic NFSv4 client for 2.5.x
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Fri, 11 Oct 2002 09:59:43 +0000 (02:59 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Fri, 11 Oct 2002 09:59:43 +0000 (02:59 -0700)
In NFSv3, an RPC is retried if the special error NFSERR_JUKEBOX is
received.  This generic bit of postprocessing happens invisibly for
synchronous RPC's, but in the async case, the ->tk_exit callback
must call nfs_async_handle_jukebox() by hand.

In NFSv4, we also need generic postprocessing of async RPC's, but
the details are different.  Therefore, we don't want to call
nfs_async_handle_jukebox(); we want to call a different, NFSv4-specific
routine.  Therefore, we want to move calls to nfs_async_handle_jukebox()
out of the "generic" NFS code and into NFSv3-specific routines.  This
has already been done for async READ and WRITE in the preceding patches,
but there is still one outstanding case: the async REMOVE in sillyrename.

This patch removes nfs_async_handle_jukebox() from the async sillyrename
path, and puts in the NFSv3 ->unlink_done() rpc_op.

fs/nfs/nfs3proc.c
fs/nfs/proc.c
fs/nfs/unlink.c
include/linux/nfs_xdr.h

index ef518001b7aec97a66318e70c97b4c68b6937564..c067a2b50dfcfa23b1d6967d48deb3708adb25a0 100644 (file)
@@ -392,16 +392,20 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr
        return 0;
 }
 
-static void
-nfs3_proc_unlink_done(struct dentry *dir, struct rpc_message *msg)
+static int
+nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
 {
+       struct rpc_message *msg = &task->tk_msg;
        struct nfs_fattr        *dir_attr;
 
+       if (nfs_async_handle_jukebox(task))
+               return 1;
        if (msg->rpc_argp) {
                dir_attr = (struct nfs_fattr*)msg->rpc_resp;
                nfs_refresh_inode(dir->d_inode, dir_attr);
                kfree(msg->rpc_argp);
        }
+       return 0;
 }
 
 static int
index d91814e23d75a38f47fa76b8e9ea9ac4852b4ee2..2ad13ec4cd275a2470c82e4b20adca0f20adc60d 100644 (file)
@@ -312,13 +312,16 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *
        return 0;
 }
 
-static void
-nfs_proc_unlink_done(struct dentry *dir, struct rpc_message *msg)
+static int
+nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
 {
+       struct rpc_message *msg = &task->tk_msg;
+       
        if (msg->rpc_argp) {
                NFS_CACHEINV(dir->d_inode);
                kfree(msg->rpc_argp);
        }
+       return 0;
 }
 
 static int
index 9697bedad53c1b308c4f36b7393ef8ba9827f6ae..82a304802c557d9fbb1865ba4d5a0e7aa5c069a8 100644 (file)
@@ -123,13 +123,12 @@ nfs_async_unlink_done(struct rpc_task *task)
        struct dentry           *dir = data->dir;
        struct inode            *dir_i;
 
-       if (nfs_async_handle_jukebox(task))
-               return;
        if (!dir)
                return;
        dir_i = dir->d_inode;
        nfs_zap_caches(dir_i);
-       NFS_PROTO(dir_i)->unlink_done(dir, &task->tk_msg);
+       if (NFS_PROTO(dir_i)->unlink_done(dir, task))
+               return;
        put_rpccred(data->cred);
        data->cred = NULL;
        dput(dir);
index bd3963d5dec6cbbfdcdc4dbcf1f5f1cc115d604e..008b14e03f20b5c8e16c964a3e3e46861f6ef3ce 100644 (file)
@@ -375,7 +375,7 @@ struct nfs_rpc_ops {
        int     (*remove)  (struct inode *, struct qstr *);
        int     (*unlink_setup)  (struct rpc_message *,
                            struct dentry *, struct qstr *);
-       void    (*unlink_done) (struct dentry *, struct rpc_message *);
+       int     (*unlink_done) (struct dentry *, struct rpc_task *);
        int     (*rename)  (struct inode *, struct qstr *,
                            struct inode *, struct qstr *);
        int     (*link)    (struct inode *, struct inode *, struct qstr *);