aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:42 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-27 22:12:42 -0400
commit91ba2eeec5e8e86e054937eb3bf5aec5b22b1830 (patch)
tree9157b8bfe90fed0b472da3ec71dadfb0c587e566 /fs/nfs/nfs4proc.c
parentcf809556149f076b7a020c10e066b2b96e79b6a1 (diff)
NFSv4: Add post-op attributes to nfs4_proc_link()
Optimise attribute revalidation when hardlinking. Add post-op attributes for the directory and the original inode. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7be3d2d15d6f..04995e39e867 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1724,22 +1724,34 @@ static int nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
1724 1724
1725static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) 1725static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
1726{ 1726{
1727 struct nfs_server *server = NFS_SERVER(inode);
1727 struct nfs4_link_arg arg = { 1728 struct nfs4_link_arg arg = {
1728 .fh = NFS_FH(inode), 1729 .fh = NFS_FH(inode),
1729 .dir_fh = NFS_FH(dir), 1730 .dir_fh = NFS_FH(dir),
1730 .name = name, 1731 .name = name,
1732 .bitmask = server->attr_bitmask,
1733 };
1734 struct nfs_fattr fattr, dir_attr;
1735 struct nfs4_link_res res = {
1736 .server = server,
1737 .fattr = &fattr,
1738 .dir_attr = &dir_attr,
1731 }; 1739 };
1732 struct nfs4_change_info cinfo = { };
1733 struct rpc_message msg = { 1740 struct rpc_message msg = {
1734 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK], 1741 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK],
1735 .rpc_argp = &arg, 1742 .rpc_argp = &arg,
1736 .rpc_resp = &cinfo, 1743 .rpc_resp = &res,
1737 }; 1744 };
1738 int status; 1745 int status;
1739 1746
1740 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); 1747 nfs_fattr_init(res.fattr);
1741 if (!status) 1748 nfs_fattr_init(res.dir_attr);
1742 update_changeattr(dir, &cinfo); 1749 status = rpc_call_sync(server->client, &msg, 0);
1750 if (!status) {
1751 update_changeattr(dir, &res.cinfo);
1752 nfs_post_op_update_inode(dir, res.dir_attr);
1753 nfs_refresh_inode(inode, res.fattr);
1754 }
1743 1755
1744 return status; 1756 return status;
1745} 1757}