aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:44 -0400
commit16e429596dec4d28e16812b3a9be27f18412c567 (patch)
treeb11c0f3829ae1225794a3d1fca68a1878a87a46d /fs/nfs/nfs4proc.c
parent6caf2c8276d371679a798058e8fdf49f5ff831a3 (diff)
NFSv4: Add post-op attributes to nfs4_proc_remove()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f96bc12c0fa0..bab47c4cb41c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1614,11 +1614,17 @@ out:
1614 1614
1615static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) 1615static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
1616{ 1616{
1617 struct nfs_server *server = NFS_SERVER(dir);
1617 struct nfs4_remove_arg args = { 1618 struct nfs4_remove_arg args = {
1618 .fh = NFS_FH(dir), 1619 .fh = NFS_FH(dir),
1619 .name = name, 1620 .name = name,
1621 .bitmask = server->attr_bitmask,
1622 };
1623 struct nfs_fattr dir_attr;
1624 struct nfs4_remove_res res = {
1625 .server = server,
1626 .dir_attr = &dir_attr,
1620 }; 1627 };
1621 struct nfs4_change_info res;
1622 struct rpc_message msg = { 1628 struct rpc_message msg = {
1623 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE], 1629 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE],
1624 .rpc_argp = &args, 1630 .rpc_argp = &args,
@@ -1626,9 +1632,12 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
1626 }; 1632 };
1627 int status; 1633 int status;
1628 1634
1629 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 1635 nfs_fattr_init(res.dir_attr);
1630 if (status == 0) 1636 status = rpc_call_sync(server->client, &msg, 0);
1631 update_changeattr(dir, &res); 1637 if (status == 0) {
1638 update_changeattr(dir, &res.cinfo);
1639 nfs_post_op_update_inode(dir, res.dir_attr);
1640 }
1632 return status; 1641 return status;
1633} 1642}
1634 1643
@@ -1646,12 +1655,14 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
1646 1655
1647struct unlink_desc { 1656struct unlink_desc {
1648 struct nfs4_remove_arg args; 1657 struct nfs4_remove_arg args;
1649 struct nfs4_change_info res; 1658 struct nfs4_remove_res res;
1659 struct nfs_fattr dir_attr;
1650}; 1660};
1651 1661
1652static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, 1662static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
1653 struct qstr *name) 1663 struct qstr *name)
1654{ 1664{
1665 struct nfs_server *server = NFS_SERVER(dir->d_inode);
1655 struct unlink_desc *up; 1666 struct unlink_desc *up;
1656 1667
1657 up = (struct unlink_desc *) kmalloc(sizeof(*up), GFP_KERNEL); 1668 up = (struct unlink_desc *) kmalloc(sizeof(*up), GFP_KERNEL);
@@ -1660,6 +1671,9 @@ static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
1660 1671
1661 up->args.fh = NFS_FH(dir->d_inode); 1672 up->args.fh = NFS_FH(dir->d_inode);
1662 up->args.name = name; 1673 up->args.name = name;
1674 up->args.bitmask = server->attr_bitmask;
1675 up->res.server = server;
1676 up->res.dir_attr = &up->dir_attr;
1663 1677
1664 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; 1678 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE];
1665 msg->rpc_argp = &up->args; 1679 msg->rpc_argp = &up->args;
@@ -1674,7 +1688,8 @@ static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
1674 1688
1675 if (msg->rpc_resp != NULL) { 1689 if (msg->rpc_resp != NULL) {
1676 up = container_of(msg->rpc_resp, struct unlink_desc, res); 1690 up = container_of(msg->rpc_resp, struct unlink_desc, res);
1677 update_changeattr(dir->d_inode, &up->res); 1691 update_changeattr(dir->d_inode, &up->res.cinfo);
1692 nfs_post_op_update_inode(dir->d_inode, up->res.dir_attr);
1678 kfree(up); 1693 kfree(up);
1679 msg->rpc_resp = NULL; 1694 msg->rpc_resp = NULL;
1680 msg->rpc_argp = NULL; 1695 msg->rpc_argp = NULL;