summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:39:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-19 15:21:39 -0400
commit4fdc17b2a7f4d9db5b08e0f963d0027f714e4104 (patch)
tree502aacc94e06962c2f3352b6ced1146245158be1 /fs/nfs/nfs3proc.c
parent3062c532ad410fe0e8320566fe2879a396be6701 (diff)
downloadlinux-4fdc17b2a7f4d9db5b08e0f963d0027f714e4104.tar.bz2
NFS: Introduce struct nfs_removeargs+nfs_removeres
We need a common structure for setting up an unlink() rpc call in order to fix the asynchronous unlink code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r--fs/nfs/nfs3proc.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 814d886b6aa4..eac07f2c99dd 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -349,23 +349,23 @@ out:
static int
nfs3_proc_remove(struct inode *dir, struct qstr *name)
{
- struct nfs_fattr dir_attr;
- struct nfs3_diropargs arg = {
- .fh = NFS_FH(dir),
- .name = name->name,
- .len = name->len
+ struct nfs_removeargs arg = {
+ .fh = NFS_FH(dir),
+ .name.len = name->len,
+ .name.name = name->name,
};
- struct rpc_message msg = {
- .rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE],
- .rpc_argp = &arg,
- .rpc_resp = &dir_attr,
+ struct nfs_removeres res;
+ struct rpc_message msg = {
+ .rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE],
+ .rpc_argp = &arg,
+ .rpc_resp = &res,
};
int status;
dprintk("NFS call remove %s\n", name->name);
- nfs_fattr_init(&dir_attr);
+ nfs_fattr_init(&res.dir_attr);
status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
- nfs_post_op_update_inode(dir, &dir_attr);
+ nfs_post_op_update_inode(dir, &res.dir_attr);
dprintk("NFS reply remove: %d\n", status);
return status;
}
@@ -374,17 +374,17 @@ static int
nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name)
{
struct unlinkxdr {
- struct nfs3_diropargs arg;
- struct nfs_fattr res;
+ struct nfs_removeargs arg;
+ struct nfs_removeres res;
} *ptr;
ptr = kmalloc(sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return -ENOMEM;
ptr->arg.fh = NFS_FH(dir->d_inode);
- ptr->arg.name = name->name;
- ptr->arg.len = name->len;
- nfs_fattr_init(&ptr->res);
+ ptr->arg.name.name = name->name;
+ ptr->arg.name.len = name->len;
+ nfs_fattr_init(&ptr->res.dir_attr);
msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
msg->rpc_argp = &ptr->arg;
msg->rpc_resp = &ptr->res;
@@ -400,7 +400,7 @@ nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
if (nfs3_async_handle_jukebox(task, dir->d_inode))
return 1;
if (msg->rpc_argp) {
- dir_attr = (struct nfs_fattr*)msg->rpc_resp;
+ dir_attr = &((struct nfs_removeres*)msg->rpc_resp)->dir_attr;
nfs_post_op_update_inode(dir->d_inode, dir_attr);
kfree(msg->rpc_argp);
}