aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r--fs/nfs/nfs3proc.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index eac07f2c99dd..c7ca5d70870b 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -370,41 +370,21 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
370 return status; 370 return status;
371} 371}
372 372
373static int 373static void
374nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name) 374nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
375{ 375{
376 struct unlinkxdr {
377 struct nfs_removeargs arg;
378 struct nfs_removeres res;
379 } *ptr;
380
381 ptr = kmalloc(sizeof(*ptr), GFP_KERNEL);
382 if (!ptr)
383 return -ENOMEM;
384 ptr->arg.fh = NFS_FH(dir->d_inode);
385 ptr->arg.name.name = name->name;
386 ptr->arg.name.len = name->len;
387 nfs_fattr_init(&ptr->res.dir_attr);
388 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; 376 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
389 msg->rpc_argp = &ptr->arg;
390 msg->rpc_resp = &ptr->res;
391 return 0;
392} 377}
393 378
394static int 379static int
395nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task) 380nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
396{ 381{
397 struct rpc_message *msg = &task->tk_msg; 382 struct nfs_removeres *res;
398 struct nfs_fattr *dir_attr; 383 if (nfs3_async_handle_jukebox(task, dir))
399 384 return 0;
400 if (nfs3_async_handle_jukebox(task, dir->d_inode)) 385 res = task->tk_msg.rpc_resp;
401 return 1; 386 nfs_post_op_update_inode(dir, &res->dir_attr);
402 if (msg->rpc_argp) { 387 return 1;
403 dir_attr = &((struct nfs_removeres*)msg->rpc_resp)->dir_attr;
404 nfs_post_op_update_inode(dir->d_inode, dir_attr);
405 kfree(msg->rpc_argp);
406 }
407 return 0;
408} 388}
409 389
410static int 390static int