aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 23dc25dbc6fa..6ca2795ccd9c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1962,48 +1962,26 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
1962 return err; 1962 return err;
1963} 1963}
1964 1964
1965struct unlink_desc { 1965static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
1966 struct nfs_removeargs args;
1967 struct nfs_removeres res;
1968};
1969
1970static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
1971 struct qstr *name)
1972{ 1966{
1973 struct nfs_server *server = NFS_SERVER(dir->d_inode); 1967 struct nfs_server *server = NFS_SERVER(dir);
1974 struct unlink_desc *up; 1968 struct nfs_removeargs *args = msg->rpc_argp;
1969 struct nfs_removeres *res = msg->rpc_resp;
1975 1970
1976 up = kmalloc(sizeof(*up), GFP_KERNEL); 1971 args->bitmask = server->attr_bitmask;
1977 if (!up) 1972 res->server = server;
1978 return -ENOMEM;
1979
1980 up->args.fh = NFS_FH(dir->d_inode);
1981 up->args.name.len = name->len;
1982 up->args.name.name = name->name;
1983 up->args.bitmask = server->attr_bitmask;
1984 up->res.server = server;
1985 nfs_fattr_init(&up->res.dir_attr);
1986
1987 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; 1973 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE];
1988 msg->rpc_argp = &up->args;
1989 msg->rpc_resp = &up->res;
1990 return 0;
1991} 1974}
1992 1975
1993static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task) 1976static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
1994{ 1977{
1995 struct rpc_message *msg = &task->tk_msg; 1978 struct nfs_removeres *res = task->tk_msg.rpc_resp;
1996 struct unlink_desc *up; 1979
1997 1980 if (nfs4_async_handle_error(task, res->server) == -EAGAIN)
1998 if (msg->rpc_resp != NULL) { 1981 return 0;
1999 up = container_of(msg->rpc_resp, struct unlink_desc, res); 1982 update_changeattr(dir, &res->cinfo);
2000 update_changeattr(dir->d_inode, &up->res.cinfo); 1983 nfs_post_op_update_inode(dir, &res->dir_attr);
2001 nfs_post_op_update_inode(dir->d_inode, &up->res.dir_attr); 1984 return 1;
2002 kfree(up);
2003 msg->rpc_resp = NULL;
2004 msg->rpc_argp = NULL;
2005 }
2006 return 0;
2007} 1985}
2008 1986
2009static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, 1987static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,