Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61868
b: refs/heads/master
c: e4eff1a
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jul 19, 2007
1 parent 7d81ca4 commit fb847eb
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 203 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fdc17b2a7f4d9db5b08e0f963d0027f714e4104
refs/heads/master: e4eff1a622edd6ab7b73acd5d8763aa2fa3fee49
4 changes: 2 additions & 2 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
lock_kernel();
drop_nlink(inode);
nfs_complete_unlink(dentry);
nfs_complete_unlink(dentry, inode);
unlock_kernel();
}
/* When creating a negative dentry, we want to renew d_time */
Expand Down Expand Up @@ -1411,7 +1411,7 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
d_move(dentry, sdentry);
error = nfs_async_unlink(dentry);
error = nfs_async_unlink(dir, dentry);
/* If we return 0 we don't unlink */
}
dput(sdentry);
Expand Down
38 changes: 9 additions & 29 deletions trunk/fs/nfs/nfs3proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,41 +370,21 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
return status;
}

static int
nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name)
static void
nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
{
struct unlinkxdr {
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->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;
return 0;
}

static int
nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
struct rpc_message *msg = &task->tk_msg;
struct nfs_fattr *dir_attr;

if (nfs3_async_handle_jukebox(task, dir->d_inode))
return 1;
if (msg->rpc_argp) {
dir_attr = &((struct nfs_removeres*)msg->rpc_resp)->dir_attr;
nfs_post_op_update_inode(dir->d_inode, dir_attr);
kfree(msg->rpc_argp);
}
return 0;
struct nfs_removeres *res;
if (nfs3_async_handle_jukebox(task, dir))
return 0;
res = task->tk_msg.rpc_resp;
nfs_post_op_update_inode(dir, &res->dir_attr);
return 1;
}

static int
Expand Down
50 changes: 14 additions & 36 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1962,48 +1962,26 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
return err;
}

struct unlink_desc {
struct nfs_removeargs args;
struct nfs_removeres res;
};

static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
struct qstr *name)
static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
{
struct nfs_server *server = NFS_SERVER(dir->d_inode);
struct unlink_desc *up;
struct nfs_server *server = NFS_SERVER(dir);
struct nfs_removeargs *args = msg->rpc_argp;
struct nfs_removeres *res = msg->rpc_resp;

up = kmalloc(sizeof(*up), GFP_KERNEL);
if (!up)
return -ENOMEM;

up->args.fh = NFS_FH(dir->d_inode);
up->args.name.len = name->len;
up->args.name.name = name->name;
up->args.bitmask = server->attr_bitmask;
up->res.server = server;
nfs_fattr_init(&up->res.dir_attr);

args->bitmask = server->attr_bitmask;
res->server = server;
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE];
msg->rpc_argp = &up->args;
msg->rpc_resp = &up->res;
return 0;
}

static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
struct rpc_message *msg = &task->tk_msg;
struct unlink_desc *up;

if (msg->rpc_resp != NULL) {
up = container_of(msg->rpc_resp, struct unlink_desc, res);
update_changeattr(dir->d_inode, &up->res.cinfo);
nfs_post_op_update_inode(dir->d_inode, &up->res.dir_attr);
kfree(up);
msg->rpc_resp = NULL;
msg->rpc_argp = NULL;
}
return 0;
struct nfs_removeres *res = task->tk_msg.rpc_resp;

if (nfs4_async_handle_error(task, res->server) == -EAGAIN)
return 0;
update_changeattr(dir, &res->cinfo);
nfs_post_op_update_inode(dir, &res->dir_attr);
return 1;
}

static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
Expand Down
26 changes: 5 additions & 21 deletions trunk/fs/nfs/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,32 +291,16 @@ nfs_proc_remove(struct inode *dir, struct qstr *name)
return status;
}

static int
nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name)
static void
nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
{
struct nfs_removeargs *arg;

arg = kmalloc(sizeof(*arg), GFP_KERNEL);
if (!arg)
return -ENOMEM;
arg->fh = NFS_FH(dir->d_inode);
arg->name.name = name->name;
arg->name.len = name->len;
msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE];
msg->rpc_argp = arg;
return 0;
}

static int
nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
struct rpc_message *msg = &task->tk_msg;

if (msg->rpc_argp) {
nfs_mark_for_revalidate(dir->d_inode);
kfree(msg->rpc_argp);
}
return 0;
nfs_mark_for_revalidate(dir);
return 1;
}

static int
Expand Down
Loading

0 comments on commit fb847eb

Please sign in to comment.