Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192300
b: refs/heads/master
c: d346890
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 14, 2010
1 parent bd87b9e commit 37fe930
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 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: 3b14d6542d7efbec614277d1cd7d6f5b5a2be9ca
refs/heads/master: d346890bea062d697e24fb4e34591428021ad011
13 changes: 9 additions & 4 deletions trunk/fs/nfs/nfs3proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,17 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
.rpc_argp = &arg,
.rpc_resp = &res,
};
int status;
int status = -ENOMEM;

dprintk("NFS call remove %s\n", name->name);
nfs_fattr_init(&res.dir_attr);
res.dir_attr = nfs_alloc_fattr();
if (res.dir_attr == NULL)
goto out;

status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
nfs_post_op_update_inode(dir, &res.dir_attr);
nfs_post_op_update_inode(dir, res.dir_attr);
nfs_free_fattr(res.dir_attr);
out:
dprintk("NFS reply remove: %d\n", status);
return status;
}
Expand All @@ -429,7 +434,7 @@ nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
if (nfs3_async_handle_jukebox(task, dir))
return 0;
res = task->tk_msg.rpc_resp;
nfs_post_op_update_inode(dir, &res->dir_attr);
nfs_post_op_update_inode(dir, res->dir_attr);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nfs/nfs3xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ nfs3_xdr_wccstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
static int
nfs3_xdr_removeres(struct rpc_rqst *req, __be32 *p, struct nfs_removeres *res)
{
return nfs3_xdr_wccstat(req, p, &res->dir_attr);
return nfs3_xdr_wccstat(req, p, res->dir_attr);
}

/*
Expand Down
13 changes: 9 additions & 4 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2599,14 +2599,19 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
.rpc_argp = &args,
.rpc_resp = &res,
};
int status;
int status = -ENOMEM;

res.dir_attr = nfs_alloc_fattr();
if (res.dir_attr == NULL)
goto out;

nfs_fattr_init(&res.dir_attr);
status = nfs4_call_sync(server, &msg, &args, &res, 1);
if (status == 0) {
update_changeattr(dir, &res.cinfo);
nfs_post_op_update_inode(dir, &res.dir_attr);
nfs_post_op_update_inode(dir, res.dir_attr);
}
nfs_free_fattr(res.dir_attr);
out:
return status;
}

Expand Down Expand Up @@ -2641,7 +2646,7 @@ static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
if (nfs4_async_handle_error(task, res->server, NULL) == -EAGAIN)
return 0;
update_changeattr(dir, &res->cinfo);
nfs_post_op_update_inode(dir, &res->dir_attr);
nfs_post_op_update_inode(dir, res->dir_attr);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4815,7 +4815,7 @@ static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs_rem
goto out;
if ((status = decode_remove(&xdr, &res->cinfo)) != 0)
goto out;
decode_getfattr(&xdr, &res->dir_attr, res->server,
decode_getfattr(&xdr, res->dir_attr, res->server,
!RPC_IS_ASYNC(rqstp->rq_task));
out:
return status;
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/nfs/unlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct nfs_unlinkdata {
struct nfs_removeres res;
struct inode *dir;
struct rpc_cred *cred;
struct nfs_fattr dir_attr;
};

/**
Expand Down Expand Up @@ -169,7 +170,7 @@ static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct n
}
nfs_sb_active(dir->i_sb);
data->args.fh = NFS_FH(dir);
nfs_fattr_init(&data->res.dir_attr);
nfs_fattr_init(data->res.dir_attr);

NFS_PROTO(dir)->unlink_setup(&msg, dir);

Expand Down Expand Up @@ -259,6 +260,7 @@ nfs_async_unlink(struct inode *dir, struct dentry *dentry)
goto out_free;
}
data->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE;
data->res.dir_attr = &data->dir_attr;

status = -EBUSY;
spin_lock(&dentry->d_lock);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfs_xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ struct nfs_removeargs {

struct nfs_removeres {
const struct nfs_server *server;
struct nfs_fattr *dir_attr;
struct nfs4_change_info cinfo;
struct nfs_fattr dir_attr;
struct nfs4_sequence_res seq_res;
};

Expand Down

0 comments on commit 37fe930

Please sign in to comment.