aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/dir.c19
-rw-r--r--fs/nfs/getroot.c2
-rw-r--r--fs/nfs/inode.c5
-rw-r--r--fs/nfs/namespace.c2
-rw-r--r--fs/nfs/nfs3proc.c7
-rw-r--r--fs/nfs/nfs4proc.c94
-rw-r--r--fs/nfs/proc.c13
-rw-r--r--include/linux/nfs_fs.h5
-rw-r--r--include/linux/nfs_xdr.h5
10 files changed, 95 insertions, 59 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c513b0cc835f..c426528deff4 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1076,7 +1076,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info,
1076 } 1076 }
1077 1077
1078 if (!(fattr->valid & NFS_ATTR_FATTR)) { 1078 if (!(fattr->valid & NFS_ATTR_FATTR)) {
1079 error = nfs_mod->rpc_ops->getattr(server, mount_info->mntfh, fattr); 1079 error = nfs_mod->rpc_ops->getattr(server, mount_info->mntfh, fattr, NULL);
1080 if (error < 0) { 1080 if (error < 0) {
1081 dprintk("nfs_create_server: getattr error = %d\n", -error); 1081 dprintk("nfs_create_server: getattr error = %d\n", -error);
1082 goto error; 1082 goto error;
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e093e73178b7..e9ab2cd9dd3d 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -460,7 +460,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
460 if (dentry == NULL) 460 if (dentry == NULL)
461 return; 461 return;
462 462
463 inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr); 463 inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr, entry->label);
464 if (IS_ERR(inode)) 464 if (IS_ERR(inode))
465 goto out; 465 goto out;
466 466
@@ -1040,6 +1040,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1040 struct dentry *parent; 1040 struct dentry *parent;
1041 struct nfs_fh *fhandle = NULL; 1041 struct nfs_fh *fhandle = NULL;
1042 struct nfs_fattr *fattr = NULL; 1042 struct nfs_fattr *fattr = NULL;
1043 struct nfs4_label *label = NULL;
1043 int error; 1044 int error;
1044 1045
1045 if (flags & LOOKUP_RCU) 1046 if (flags & LOOKUP_RCU)
@@ -1082,7 +1083,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1082 if (fhandle == NULL || fattr == NULL) 1083 if (fhandle == NULL || fattr == NULL)
1083 goto out_error; 1084 goto out_error;
1084 1085
1085 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); 1086 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label);
1086 if (error) 1087 if (error)
1087 goto out_bad; 1088 goto out_bad;
1088 if (nfs_compare_fh(NFS_FH(inode), fhandle)) 1089 if (nfs_compare_fh(NFS_FH(inode), fhandle))
@@ -1256,6 +1257,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
1256 struct inode *inode = NULL; 1257 struct inode *inode = NULL;
1257 struct nfs_fh *fhandle = NULL; 1258 struct nfs_fh *fhandle = NULL;
1258 struct nfs_fattr *fattr = NULL; 1259 struct nfs_fattr *fattr = NULL;
1260 struct nfs4_label *label = NULL;
1259 int error; 1261 int error;
1260 1262
1261 dfprintk(VFS, "NFS: lookup(%s/%s)\n", 1263 dfprintk(VFS, "NFS: lookup(%s/%s)\n",
@@ -1285,14 +1287,14 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
1285 parent = dentry->d_parent; 1287 parent = dentry->d_parent;
1286 /* Protect against concurrent sillydeletes */ 1288 /* Protect against concurrent sillydeletes */
1287 nfs_block_sillyrename(parent); 1289 nfs_block_sillyrename(parent);
1288 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); 1290 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label);
1289 if (error == -ENOENT) 1291 if (error == -ENOENT)
1290 goto no_entry; 1292 goto no_entry;
1291 if (error < 0) { 1293 if (error < 0) {
1292 res = ERR_PTR(error); 1294 res = ERR_PTR(error);
1293 goto out_unblock_sillyrename; 1295 goto out_unblock_sillyrename;
1294 } 1296 }
1295 inode = nfs_fhget(dentry->d_sb, fhandle, fattr); 1297 inode = nfs_fhget(dentry->d_sb, fhandle, fattr, label);
1296 res = ERR_CAST(inode); 1298 res = ERR_CAST(inode);
1297 if (IS_ERR(res)) 1299 if (IS_ERR(res))
1298 goto out_unblock_sillyrename; 1300 goto out_unblock_sillyrename;
@@ -1528,7 +1530,8 @@ no_open:
1528 * Code common to create, mkdir, and mknod. 1530 * Code common to create, mkdir, and mknod.
1529 */ 1531 */
1530int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle, 1532int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
1531 struct nfs_fattr *fattr) 1533 struct nfs_fattr *fattr,
1534 struct nfs4_label *label)
1532{ 1535{
1533 struct dentry *parent = dget_parent(dentry); 1536 struct dentry *parent = dget_parent(dentry);
1534 struct inode *dir = parent->d_inode; 1537 struct inode *dir = parent->d_inode;
@@ -1541,18 +1544,18 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
1541 if (dentry->d_inode) 1544 if (dentry->d_inode)
1542 goto out; 1545 goto out;
1543 if (fhandle->size == 0) { 1546 if (fhandle->size == 0) {
1544 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); 1547 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, NULL);
1545 if (error) 1548 if (error)
1546 goto out_error; 1549 goto out_error;
1547 } 1550 }
1548 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 1551 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1549 if (!(fattr->valid & NFS_ATTR_FATTR)) { 1552 if (!(fattr->valid & NFS_ATTR_FATTR)) {
1550 struct nfs_server *server = NFS_SB(dentry->d_sb); 1553 struct nfs_server *server = NFS_SB(dentry->d_sb);
1551 error = server->nfs_client->rpc_ops->getattr(server, fhandle, fattr); 1554 error = server->nfs_client->rpc_ops->getattr(server, fhandle, fattr, NULL);
1552 if (error < 0) 1555 if (error < 0)
1553 goto out_error; 1556 goto out_error;
1554 } 1557 }
1555 inode = nfs_fhget(dentry->d_sb, fhandle, fattr); 1558 inode = nfs_fhget(dentry->d_sb, fhandle, fattr, label);
1556 error = PTR_ERR(inode); 1559 error = PTR_ERR(inode);
1557 if (IS_ERR(inode)) 1560 if (IS_ERR(inode))
1558 goto out_error; 1561 goto out_error;
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 44efaa8c5f78..66984a9aafaa 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -95,7 +95,7 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh,
95 goto out; 95 goto out;
96 } 96 }
97 97
98 inode = nfs_fhget(sb, mntfh, fsinfo.fattr); 98 inode = nfs_fhget(sb, mntfh, fsinfo.fattr, NULL);
99 if (IS_ERR(inode)) { 99 if (IS_ERR(inode)) {
100 dprintk("nfs_get_root: get root inode failed\n"); 100 dprintk("nfs_get_root: get root inode failed\n");
101 ret = ERR_CAST(inode); 101 ret = ERR_CAST(inode);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 07fcf0b90669..58e7bf876e6c 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -290,7 +290,7 @@ EXPORT_SYMBOL_GPL(nfs4_label_alloc);
290 * instead of inode number. 290 * instead of inode number.
291 */ 291 */
292struct inode * 292struct inode *
293nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) 293nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, struct nfs4_label *label)
294{ 294{
295 struct nfs_find_desc desc = { 295 struct nfs_find_desc desc = {
296 .fh = fh, 296 .fh = fh,
@@ -818,6 +818,7 @@ int
818__nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) 818__nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
819{ 819{
820 int status = -ESTALE; 820 int status = -ESTALE;
821 struct nfs4_label *label = NULL;
821 struct nfs_fattr *fattr = NULL; 822 struct nfs_fattr *fattr = NULL;
822 struct nfs_inode *nfsi = NFS_I(inode); 823 struct nfs_inode *nfsi = NFS_I(inode);
823 824
@@ -835,7 +836,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
835 goto out; 836 goto out;
836 837
837 nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); 838 nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
838 status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr); 839 status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr, label);
839 if (status != 0) { 840 if (status != 0) {
840 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", 841 dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n",
841 inode->i_sb->s_id, 842 inode->i_sb->s_id,
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index fc8dc20fdeb9..348b535cd786 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -280,7 +280,7 @@ struct vfsmount *nfs_submount(struct nfs_server *server, struct dentry *dentry,
280 struct dentry *parent = dget_parent(dentry); 280 struct dentry *parent = dget_parent(dentry);
281 281
282 /* Look it up again to get its attributes */ 282 /* Look it up again to get its attributes */
283 err = server->nfs_client->rpc_ops->lookup(parent->d_inode, &dentry->d_name, fh, fattr); 283 err = server->nfs_client->rpc_ops->lookup(parent->d_inode, &dentry->d_name, fh, fattr, NULL);
284 dput(parent); 284 dput(parent);
285 if (err != 0) 285 if (err != 0)
286 return ERR_PTR(err); 286 return ERR_PTR(err);
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 43ea96ced28c..39c185b03cc0 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -98,7 +98,7 @@ nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
98 */ 98 */
99static int 99static int
100nfs3_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, 100nfs3_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
101 struct nfs_fattr *fattr) 101 struct nfs_fattr *fattr, struct nfs4_label *label)
102{ 102{
103 struct rpc_message msg = { 103 struct rpc_message msg = {
104 .rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR], 104 .rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR],
@@ -143,7 +143,8 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
143 143
144static int 144static int
145nfs3_proc_lookup(struct inode *dir, struct qstr *name, 145nfs3_proc_lookup(struct inode *dir, struct qstr *name,
146 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 146 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
147 struct nfs4_label *label)
147{ 148{
148 struct nfs3_diropargs arg = { 149 struct nfs3_diropargs arg = {
149 .fh = NFS_FH(dir), 150 .fh = NFS_FH(dir),
@@ -300,7 +301,7 @@ static int nfs3_do_create(struct inode *dir, struct dentry *dentry, struct nfs3_
300 status = rpc_call_sync(NFS_CLIENT(dir), &data->msg, 0); 301 status = rpc_call_sync(NFS_CLIENT(dir), &data->msg, 0);
301 nfs_post_op_update_inode(dir, data->res.dir_attr); 302 nfs_post_op_update_inode(dir, data->res.dir_attr);
302 if (status == 0) 303 if (status == 0)
303 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); 304 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, NULL);
304 return status; 305 return status;
305} 306}
306 307
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index bcf60f15213c..004de2081554 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -77,11 +77,12 @@ static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
77static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); 77static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
78static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *); 78static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *);
79static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr); 79static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr);
80static int nfs4_proc_getattr(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *); 80static int nfs4_proc_getattr(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *label);
81static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr); 81static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label);
82static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, 82static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
83 struct nfs_fattr *fattr, struct iattr *sattr, 83 struct nfs_fattr *fattr, struct iattr *sattr,
84 struct nfs4_state *state); 84 struct nfs4_state *state, struct nfs4_label *ilabel,
85 struct nfs4_label *olabel);
85#ifdef CONFIG_NFS_V4_1 86#ifdef CONFIG_NFS_V4_1
86static int nfs41_test_stateid(struct nfs_server *, nfs4_stateid *); 87static int nfs41_test_stateid(struct nfs_server *, nfs4_stateid *);
87static int nfs41_free_stateid(struct nfs_server *, nfs4_stateid *); 88static int nfs41_free_stateid(struct nfs_server *, nfs4_stateid *);
@@ -762,6 +763,7 @@ struct nfs4_opendata {
762 struct nfs4_string owner_name; 763 struct nfs4_string owner_name;
763 struct nfs4_string group_name; 764 struct nfs4_string group_name;
764 struct nfs_fattr f_attr; 765 struct nfs_fattr f_attr;
766 struct nfs4_label *f_label;
765 struct dentry *dir; 767 struct dentry *dir;
766 struct dentry *dentry; 768 struct dentry *dentry;
767 struct nfs4_state_owner *owner; 769 struct nfs4_state_owner *owner;
@@ -807,6 +809,7 @@ nfs4_map_atomic_open_claim(struct nfs_server *server,
807static void nfs4_init_opendata_res(struct nfs4_opendata *p) 809static void nfs4_init_opendata_res(struct nfs4_opendata *p)
808{ 810{
809 p->o_res.f_attr = &p->f_attr; 811 p->o_res.f_attr = &p->f_attr;
812 p->o_res.f_label = p->f_label;
810 p->o_res.seqid = p->o_arg.seqid; 813 p->o_res.seqid = p->o_arg.seqid;
811 p->c_res.seqid = p->c_arg.seqid; 814 p->c_res.seqid = p->c_arg.seqid;
812 p->o_res.server = p->o_arg.server; 815 p->o_res.server = p->o_arg.server;
@@ -818,6 +821,7 @@ static void nfs4_init_opendata_res(struct nfs4_opendata *p)
818static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, 821static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
819 struct nfs4_state_owner *sp, fmode_t fmode, int flags, 822 struct nfs4_state_owner *sp, fmode_t fmode, int flags,
820 const struct iattr *attrs, 823 const struct iattr *attrs,
824 struct nfs4_label *label,
821 enum open_claim_type4 claim, 825 enum open_claim_type4 claim,
822 gfp_t gfp_mask) 826 gfp_t gfp_mask)
823{ 827{
@@ -854,6 +858,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
854 p->o_arg.server = server; 858 p->o_arg.server = server;
855 p->o_arg.bitmask = server->attr_bitmask; 859 p->o_arg.bitmask = server->attr_bitmask;
856 p->o_arg.open_bitmap = &nfs4_fattr_bitmap[0]; 860 p->o_arg.open_bitmap = &nfs4_fattr_bitmap[0];
861 p->o_arg.label = label;
857 p->o_arg.claim = nfs4_map_atomic_open_claim(server, claim); 862 p->o_arg.claim = nfs4_map_atomic_open_claim(server, claim);
858 switch (p->o_arg.claim) { 863 switch (p->o_arg.claim) {
859 case NFS4_OPEN_CLAIM_NULL: 864 case NFS4_OPEN_CLAIM_NULL:
@@ -1205,7 +1210,7 @@ _nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data)
1205 ret = -EAGAIN; 1210 ret = -EAGAIN;
1206 if (!(data->f_attr.valid & NFS_ATTR_FATTR)) 1211 if (!(data->f_attr.valid & NFS_ATTR_FATTR))
1207 goto err; 1212 goto err;
1208 inode = nfs_fhget(data->dir->d_sb, &data->o_res.fh, &data->f_attr); 1213 inode = nfs_fhget(data->dir->d_sb, &data->o_res.fh, &data->f_attr, data->f_label);
1209 ret = PTR_ERR(inode); 1214 ret = PTR_ERR(inode);
1210 if (IS_ERR(inode)) 1215 if (IS_ERR(inode))
1211 goto err; 1216 goto err;
@@ -1258,7 +1263,7 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context
1258 struct nfs4_opendata *opendata; 1263 struct nfs4_opendata *opendata;
1259 1264
1260 opendata = nfs4_opendata_alloc(ctx->dentry, state->owner, 0, 0, 1265 opendata = nfs4_opendata_alloc(ctx->dentry, state->owner, 0, 0,
1261 NULL, claim, GFP_NOFS); 1266 NULL, NULL, claim, GFP_NOFS);
1262 if (opendata == NULL) 1267 if (opendata == NULL)
1263 return ERR_PTR(-ENOMEM); 1268 return ERR_PTR(-ENOMEM);
1264 opendata->state = state; 1269 opendata->state = state;
@@ -1784,7 +1789,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
1784 return status; 1789 return status;
1785 } 1790 }
1786 if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) 1791 if (!(o_res->f_attr->valid & NFS_ATTR_FATTR))
1787 _nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr); 1792 _nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr, o_res->f_label);
1788 return 0; 1793 return 0;
1789} 1794}
1790 1795
@@ -1982,6 +1987,7 @@ static int _nfs4_do_open(struct inode *dir,
1982 fmode_t fmode, 1987 fmode_t fmode,
1983 int flags, 1988 int flags,
1984 struct iattr *sattr, 1989 struct iattr *sattr,
1990 struct nfs4_label *label,
1985 struct rpc_cred *cred, 1991 struct rpc_cred *cred,
1986 struct nfs4_state **res, 1992 struct nfs4_state **res,
1987 struct nfs4_threshold **ctx_th) 1993 struct nfs4_threshold **ctx_th)
@@ -1991,6 +1997,7 @@ static int _nfs4_do_open(struct inode *dir,
1991 struct nfs_server *server = NFS_SERVER(dir); 1997 struct nfs_server *server = NFS_SERVER(dir);
1992 struct nfs4_opendata *opendata; 1998 struct nfs4_opendata *opendata;
1993 enum open_claim_type4 claim = NFS4_OPEN_CLAIM_NULL; 1999 enum open_claim_type4 claim = NFS4_OPEN_CLAIM_NULL;
2000 struct nfs4_label *olabel = NULL;
1994 int status; 2001 int status;
1995 2002
1996 /* Protect against reboot recovery conflicts */ 2003 /* Protect against reboot recovery conflicts */
@@ -2009,7 +2016,7 @@ static int _nfs4_do_open(struct inode *dir,
2009 if (dentry->d_inode) 2016 if (dentry->d_inode)
2010 claim = NFS4_OPEN_CLAIM_FH; 2017 claim = NFS4_OPEN_CLAIM_FH;
2011 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr, 2018 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr,
2012 claim, GFP_KERNEL); 2019 label, claim, GFP_KERNEL);
2013 if (opendata == NULL) 2020 if (opendata == NULL)
2014 goto err_put_state_owner; 2021 goto err_put_state_owner;
2015 2022
@@ -2033,10 +2040,11 @@ static int _nfs4_do_open(struct inode *dir,
2033 nfs_fattr_init(opendata->o_res.f_attr); 2040 nfs_fattr_init(opendata->o_res.f_attr);
2034 status = nfs4_do_setattr(state->inode, cred, 2041 status = nfs4_do_setattr(state->inode, cred,
2035 opendata->o_res.f_attr, sattr, 2042 opendata->o_res.f_attr, sattr,
2036 state); 2043 state, label, olabel);
2037 if (status == 0) 2044 if (status == 0) {
2038 nfs_setattr_update_inode(state->inode, sattr); 2045 nfs_setattr_update_inode(state->inode, sattr);
2039 nfs_post_op_update_inode(state->inode, opendata->o_res.f_attr); 2046 nfs_post_op_update_inode(state->inode, opendata->o_res.f_attr);
2047 }
2040 } 2048 }
2041 2049
2042 if (pnfs_use_threshold(ctx_th, opendata->f_attr.mdsthreshold, server)) 2050 if (pnfs_use_threshold(ctx_th, opendata->f_attr.mdsthreshold, server))
@@ -2065,6 +2073,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir,
2065 fmode_t fmode, 2073 fmode_t fmode,
2066 int flags, 2074 int flags,
2067 struct iattr *sattr, 2075 struct iattr *sattr,
2076 struct nfs4_label *label,
2068 struct rpc_cred *cred, 2077 struct rpc_cred *cred,
2069 struct nfs4_threshold **ctx_th) 2078 struct nfs4_threshold **ctx_th)
2070{ 2079{
@@ -2075,7 +2084,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir,
2075 2084
2076 fmode &= FMODE_READ|FMODE_WRITE|FMODE_EXEC; 2085 fmode &= FMODE_READ|FMODE_WRITE|FMODE_EXEC;
2077 do { 2086 do {
2078 status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, cred, 2087 status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, label, cred,
2079 &res, ctx_th); 2088 &res, ctx_th);
2080 if (status == 0) 2089 if (status == 0)
2081 break; 2090 break;
@@ -2122,7 +2131,8 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir,
2122 2131
2123static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, 2132static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2124 struct nfs_fattr *fattr, struct iattr *sattr, 2133 struct nfs_fattr *fattr, struct iattr *sattr,
2125 struct nfs4_state *state) 2134 struct nfs4_state *state, struct nfs4_label *ilabel,
2135 struct nfs4_label *olabel)
2126{ 2136{
2127 struct nfs_server *server = NFS_SERVER(inode); 2137 struct nfs_server *server = NFS_SERVER(inode);
2128 struct nfs_setattrargs arg = { 2138 struct nfs_setattrargs arg = {
@@ -2130,9 +2140,11 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2130 .iap = sattr, 2140 .iap = sattr,
2131 .server = server, 2141 .server = server,
2132 .bitmask = server->attr_bitmask, 2142 .bitmask = server->attr_bitmask,
2143 .label = ilabel,
2133 }; 2144 };
2134 struct nfs_setattrres res = { 2145 struct nfs_setattrres res = {
2135 .fattr = fattr, 2146 .fattr = fattr,
2147 .label = olabel,
2136 .server = server, 2148 .server = server,
2137 }; 2149 };
2138 struct rpc_message msg = { 2150 struct rpc_message msg = {
@@ -2172,7 +2184,8 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2172 2184
2173static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, 2185static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2174 struct nfs_fattr *fattr, struct iattr *sattr, 2186 struct nfs_fattr *fattr, struct iattr *sattr,
2175 struct nfs4_state *state) 2187 struct nfs4_state *state, struct nfs4_label *ilabel,
2188 struct nfs4_label *olabel)
2176{ 2189{
2177 struct nfs_server *server = NFS_SERVER(inode); 2190 struct nfs_server *server = NFS_SERVER(inode);
2178 struct nfs4_exception exception = { 2191 struct nfs4_exception exception = {
@@ -2181,7 +2194,7 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2181 }; 2194 };
2182 int err; 2195 int err;
2183 do { 2196 do {
2184 err = _nfs4_do_setattr(inode, cred, fattr, sattr, state); 2197 err = _nfs4_do_setattr(inode, cred, fattr, sattr, state, ilabel, olabel);
2185 switch (err) { 2198 switch (err) {
2186 case -NFS4ERR_OPENMODE: 2199 case -NFS4ERR_OPENMODE:
2187 if (!(sattr->ia_valid & ATTR_SIZE)) { 2200 if (!(sattr->ia_valid & ATTR_SIZE)) {
@@ -2426,9 +2439,10 @@ static struct inode *
2426nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr) 2439nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr)
2427{ 2440{
2428 struct nfs4_state *state; 2441 struct nfs4_state *state;
2442 struct nfs4_label *label = NULL;
2429 2443
2430 /* Protect against concurrent sillydeletes */ 2444 /* Protect against concurrent sillydeletes */
2431 state = nfs4_do_open(dir, ctx->dentry, ctx->mode, open_flags, attr, 2445 state = nfs4_do_open(dir, ctx->dentry, ctx->mode, open_flags, attr, label,
2432 ctx->cred, &ctx->mdsthreshold); 2446 ctx->cred, &ctx->mdsthreshold);
2433 if (IS_ERR(state)) 2447 if (IS_ERR(state))
2434 return ERR_CAST(state); 2448 return ERR_CAST(state);
@@ -2648,6 +2662,7 @@ static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *mntfh,
2648{ 2662{
2649 int error; 2663 int error;
2650 struct nfs_fattr *fattr = info->fattr; 2664 struct nfs_fattr *fattr = info->fattr;
2665 struct nfs4_label *label = NULL;
2651 2666
2652 error = nfs4_server_capabilities(server, mntfh); 2667 error = nfs4_server_capabilities(server, mntfh);
2653 if (error < 0) { 2668 if (error < 0) {
@@ -2655,7 +2670,7 @@ static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *mntfh,
2655 return error; 2670 return error;
2656 } 2671 }
2657 2672
2658 error = nfs4_proc_getattr(server, mntfh, fattr); 2673 error = nfs4_proc_getattr(server, mntfh, fattr, label);
2659 if (error < 0) { 2674 if (error < 0) {
2660 dprintk("nfs4_get_root: getattr error = %d\n", -error); 2675 dprintk("nfs4_get_root: getattr error = %d\n", -error);
2661 return error; 2676 return error;
@@ -2711,7 +2726,8 @@ out:
2711 return status; 2726 return status;
2712} 2727}
2713 2728
2714static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr) 2729static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2730 struct nfs_fattr *fattr, struct nfs4_label *label)
2715{ 2731{
2716 struct nfs4_getattr_arg args = { 2732 struct nfs4_getattr_arg args = {
2717 .fh = fhandle, 2733 .fh = fhandle,
@@ -2719,6 +2735,7 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2719 }; 2735 };
2720 struct nfs4_getattr_res res = { 2736 struct nfs4_getattr_res res = {
2721 .fattr = fattr, 2737 .fattr = fattr,
2738 .label = label,
2722 .server = server, 2739 .server = server,
2723 }; 2740 };
2724 struct rpc_message msg = { 2741 struct rpc_message msg = {
@@ -2731,13 +2748,14 @@ static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2731 return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0); 2748 return nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
2732} 2749}
2733 2750
2734static int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr) 2751static int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2752 struct nfs_fattr *fattr, struct nfs4_label *label)
2735{ 2753{
2736 struct nfs4_exception exception = { }; 2754 struct nfs4_exception exception = { };
2737 int err; 2755 int err;
2738 do { 2756 do {
2739 err = nfs4_handle_exception(server, 2757 err = nfs4_handle_exception(server,
2740 _nfs4_proc_getattr(server, fhandle, fattr), 2758 _nfs4_proc_getattr(server, fhandle, fattr, label),
2741 &exception); 2759 &exception);
2742 } while (exception.retry); 2760 } while (exception.retry);
2743 return err; 2761 return err;
@@ -2793,7 +2811,7 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
2793 } 2811 }
2794 } 2812 }
2795 2813
2796 status = nfs4_do_setattr(inode, cred, fattr, sattr, state); 2814 status = nfs4_do_setattr(inode, cred, fattr, sattr, state, NULL, NULL);
2797 if (status == 0) 2815 if (status == 0)
2798 nfs_setattr_update_inode(inode, sattr); 2816 nfs_setattr_update_inode(inode, sattr);
2799 return status; 2817 return status;
@@ -2801,7 +2819,7 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
2801 2819
2802static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, 2820static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
2803 const struct qstr *name, struct nfs_fh *fhandle, 2821 const struct qstr *name, struct nfs_fh *fhandle,
2804 struct nfs_fattr *fattr) 2822 struct nfs_fattr *fattr, struct nfs4_label *label)
2805{ 2823{
2806 struct nfs_server *server = NFS_SERVER(dir); 2824 struct nfs_server *server = NFS_SERVER(dir);
2807 int status; 2825 int status;
@@ -2839,13 +2857,13 @@ static void nfs_fixup_secinfo_attributes(struct nfs_fattr *fattr)
2839 2857
2840static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, 2858static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
2841 struct qstr *name, struct nfs_fh *fhandle, 2859 struct qstr *name, struct nfs_fh *fhandle,
2842 struct nfs_fattr *fattr) 2860 struct nfs_fattr *fattr, struct nfs4_label *label)
2843{ 2861{
2844 struct nfs4_exception exception = { }; 2862 struct nfs4_exception exception = { };
2845 struct rpc_clnt *client = *clnt; 2863 struct rpc_clnt *client = *clnt;
2846 int err; 2864 int err;
2847 do { 2865 do {
2848 err = _nfs4_proc_lookup(client, dir, name, fhandle, fattr); 2866 err = _nfs4_proc_lookup(client, dir, name, fhandle, fattr, label);
2849 switch (err) { 2867 switch (err) {
2850 case -NFS4ERR_BADNAME: 2868 case -NFS4ERR_BADNAME:
2851 err = -ENOENT; 2869 err = -ENOENT;
@@ -2879,12 +2897,13 @@ out:
2879} 2897}
2880 2898
2881static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, 2899static int nfs4_proc_lookup(struct inode *dir, struct qstr *name,
2882 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 2900 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
2901 struct nfs4_label *label)
2883{ 2902{
2884 int status; 2903 int status;
2885 struct rpc_clnt *client = NFS_CLIENT(dir); 2904 struct rpc_clnt *client = NFS_CLIENT(dir);
2886 2905
2887 status = nfs4_proc_lookup_common(&client, dir, name, fhandle, fattr); 2906 status = nfs4_proc_lookup_common(&client, dir, name, fhandle, fattr, label);
2888 if (client != NFS_CLIENT(dir)) { 2907 if (client != NFS_CLIENT(dir)) {
2889 rpc_shutdown_client(client); 2908 rpc_shutdown_client(client);
2890 nfs_fixup_secinfo_attributes(fattr); 2909 nfs_fixup_secinfo_attributes(fattr);
@@ -2899,7 +2918,7 @@ nfs4_proc_lookup_mountpoint(struct inode *dir, struct qstr *name,
2899 int status; 2918 int status;
2900 struct rpc_clnt *client = rpc_clone_client(NFS_CLIENT(dir)); 2919 struct rpc_clnt *client = rpc_clone_client(NFS_CLIENT(dir));
2901 2920
2902 status = nfs4_proc_lookup_common(&client, dir, name, fhandle, fattr); 2921 status = nfs4_proc_lookup_common(&client, dir, name, fhandle, fattr, NULL);
2903 if (status < 0) { 2922 if (status < 0) {
2904 rpc_shutdown_client(client); 2923 rpc_shutdown_client(client);
2905 return ERR_PTR(status); 2924 return ERR_PTR(status);
@@ -3029,6 +3048,7 @@ static int
3029nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, 3048nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
3030 int flags) 3049 int flags)
3031{ 3050{
3051 struct nfs4_label *ilabel = NULL;
3032 struct nfs_open_context *ctx; 3052 struct nfs_open_context *ctx;
3033 struct nfs4_state *state; 3053 struct nfs4_state *state;
3034 int status = 0; 3054 int status = 0;
@@ -3039,7 +3059,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
3039 3059
3040 sattr->ia_mode &= ~current_umask(); 3060 sattr->ia_mode &= ~current_umask();
3041 state = nfs4_do_open(dir, dentry, ctx->mode, 3061 state = nfs4_do_open(dir, dentry, ctx->mode,
3042 flags, sattr, ctx->cred, 3062 flags, sattr, ilabel, ctx->cred,
3043 &ctx->mdsthreshold); 3063 &ctx->mdsthreshold);
3044 d_drop(dentry); 3064 d_drop(dentry);
3045 if (IS_ERR(state)) { 3065 if (IS_ERR(state)) {
@@ -3207,6 +3227,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *
3207 }; 3227 };
3208 struct nfs4_link_res res = { 3228 struct nfs4_link_res res = {
3209 .server = server, 3229 .server = server,
3230 .label = NULL,
3210 }; 3231 };
3211 struct rpc_message msg = { 3232 struct rpc_message msg = {
3212 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK], 3233 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK],
@@ -3247,6 +3268,7 @@ struct nfs4_createdata {
3247 struct nfs4_create_res res; 3268 struct nfs4_create_res res;
3248 struct nfs_fh fh; 3269 struct nfs_fh fh;
3249 struct nfs_fattr fattr; 3270 struct nfs_fattr fattr;
3271 struct nfs4_label *label;
3250}; 3272};
3251 3273
3252static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, 3274static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
@@ -3270,6 +3292,7 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
3270 data->res.server = server; 3292 data->res.server = server;
3271 data->res.fh = &data->fh; 3293 data->res.fh = &data->fh;
3272 data->res.fattr = &data->fattr; 3294 data->res.fattr = &data->fattr;
3295 data->res.label = data->label;
3273 nfs_fattr_init(data->res.fattr); 3296 nfs_fattr_init(data->res.fattr);
3274 } 3297 }
3275 return data; 3298 return data;
@@ -3281,7 +3304,7 @@ static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_
3281 &data->arg.seq_args, &data->res.seq_res, 1); 3304 &data->arg.seq_args, &data->res.seq_res, 1);
3282 if (status == 0) { 3305 if (status == 0) {
3283 update_changeattr(dir, &data->res.dir_cinfo); 3306 update_changeattr(dir, &data->res.dir_cinfo);
3284 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); 3307 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, data->res.label);
3285 } 3308 }
3286 return status; 3309 return status;
3287} 3310}
@@ -3292,7 +3315,8 @@ static void nfs4_free_createdata(struct nfs4_createdata *data)
3292} 3315}
3293 3316
3294static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry, 3317static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
3295 struct page *page, unsigned int len, struct iattr *sattr) 3318 struct page *page, unsigned int len, struct iattr *sattr,
3319 struct nfs4_label *label)
3296{ 3320{
3297 struct nfs4_createdata *data; 3321 struct nfs4_createdata *data;
3298 int status = -ENAMETOOLONG; 3322 int status = -ENAMETOOLONG;
@@ -3308,6 +3332,7 @@ static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
3308 data->msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SYMLINK]; 3332 data->msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SYMLINK];
3309 data->arg.u.symlink.pages = &page; 3333 data->arg.u.symlink.pages = &page;
3310 data->arg.u.symlink.len = len; 3334 data->arg.u.symlink.len = len;
3335 data->arg.label = label;
3311 3336
3312 status = nfs4_do_create(dir, dentry, data); 3337 status = nfs4_do_create(dir, dentry, data);
3313 3338
@@ -3320,18 +3345,19 @@ static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
3320 struct page *page, unsigned int len, struct iattr *sattr) 3345 struct page *page, unsigned int len, struct iattr *sattr)
3321{ 3346{
3322 struct nfs4_exception exception = { }; 3347 struct nfs4_exception exception = { };
3348 struct nfs4_label *label = NULL;
3323 int err; 3349 int err;
3324 do { 3350 do {
3325 err = nfs4_handle_exception(NFS_SERVER(dir), 3351 err = nfs4_handle_exception(NFS_SERVER(dir),
3326 _nfs4_proc_symlink(dir, dentry, page, 3352 _nfs4_proc_symlink(dir, dentry, page,
3327 len, sattr), 3353 len, sattr, label),
3328 &exception); 3354 &exception);
3329 } while (exception.retry); 3355 } while (exception.retry);
3330 return err; 3356 return err;
3331} 3357}
3332 3358
3333static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry, 3359static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
3334 struct iattr *sattr) 3360 struct iattr *sattr, struct nfs4_label *label)
3335{ 3361{
3336 struct nfs4_createdata *data; 3362 struct nfs4_createdata *data;
3337 int status = -ENOMEM; 3363 int status = -ENOMEM;
@@ -3340,6 +3366,7 @@ static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
3340 if (data == NULL) 3366 if (data == NULL)
3341 goto out; 3367 goto out;
3342 3368
3369 data->arg.label = label;
3343 status = nfs4_do_create(dir, dentry, data); 3370 status = nfs4_do_create(dir, dentry, data);
3344 3371
3345 nfs4_free_createdata(data); 3372 nfs4_free_createdata(data);
@@ -3351,12 +3378,13 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
3351 struct iattr *sattr) 3378 struct iattr *sattr)
3352{ 3379{
3353 struct nfs4_exception exception = { }; 3380 struct nfs4_exception exception = { };
3381 struct nfs4_label *label = NULL;
3354 int err; 3382 int err;
3355 3383
3356 sattr->ia_mode &= ~current_umask(); 3384 sattr->ia_mode &= ~current_umask();
3357 do { 3385 do {
3358 err = nfs4_handle_exception(NFS_SERVER(dir), 3386 err = nfs4_handle_exception(NFS_SERVER(dir),
3359 _nfs4_proc_mkdir(dir, dentry, sattr), 3387 _nfs4_proc_mkdir(dir, dentry, sattr, label),
3360 &exception); 3388 &exception);
3361 } while (exception.retry); 3389 } while (exception.retry);
3362 return err; 3390 return err;
@@ -3441,7 +3469,7 @@ static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
3441 status = -EINVAL; 3469 status = -EINVAL;
3442 goto out_free; 3470 goto out_free;
3443 } 3471 }
3444 3472
3445 status = nfs4_do_create(dir, dentry, data); 3473 status = nfs4_do_create(dir, dentry, data);
3446out_free: 3474out_free:
3447 nfs4_free_createdata(data); 3475 nfs4_free_createdata(data);
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index fc8de9016acf..c041c41f7a52 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -98,7 +98,7 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
98 */ 98 */
99static int 99static int
100nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, 100nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
101 struct nfs_fattr *fattr) 101 struct nfs_fattr *fattr, struct nfs4_label *label)
102{ 102{
103 struct rpc_message msg = { 103 struct rpc_message msg = {
104 .rpc_proc = &nfs_procedures[NFSPROC_GETATTR], 104 .rpc_proc = &nfs_procedures[NFSPROC_GETATTR],
@@ -146,7 +146,8 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
146 146
147static int 147static int
148nfs_proc_lookup(struct inode *dir, struct qstr *name, 148nfs_proc_lookup(struct inode *dir, struct qstr *name,
149 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 149 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
150 struct nfs4_label *label)
150{ 151{
151 struct nfs_diropargs arg = { 152 struct nfs_diropargs arg = {
152 .fh = NFS_FH(dir), 153 .fh = NFS_FH(dir),
@@ -243,7 +244,7 @@ nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
243 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 244 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
244 nfs_mark_for_revalidate(dir); 245 nfs_mark_for_revalidate(dir);
245 if (status == 0) 246 if (status == 0)
246 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); 247 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, NULL);
247 nfs_free_createdata(data); 248 nfs_free_createdata(data);
248out: 249out:
249 dprintk("NFS reply create: %d\n", status); 250 dprintk("NFS reply create: %d\n", status);
@@ -290,7 +291,7 @@ nfs_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
290 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 291 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
291 } 292 }
292 if (status == 0) 293 if (status == 0)
293 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); 294 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, NULL);
294 nfs_free_createdata(data); 295 nfs_free_createdata(data);
295out: 296out:
296 dprintk("NFS reply mknod: %d\n", status); 297 dprintk("NFS reply mknod: %d\n", status);
@@ -442,7 +443,7 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
442 * should fill in the data with a LOOKUP call on the wire. 443 * should fill in the data with a LOOKUP call on the wire.
443 */ 444 */
444 if (status == 0) 445 if (status == 0)
445 status = nfs_instantiate(dentry, fh, fattr); 446 status = nfs_instantiate(dentry, fh, fattr, NULL);
446 447
447out_free: 448out_free:
448 nfs_free_fattr(fattr); 449 nfs_free_fattr(fattr);
@@ -471,7 +472,7 @@ nfs_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
471 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 472 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
472 nfs_mark_for_revalidate(dir); 473 nfs_mark_for_revalidate(dir);
473 if (status == 0) 474 if (status == 0)
474 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr); 475 status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, NULL);
475 nfs_free_createdata(data); 476 nfs_free_createdata(data);
476out: 477out:
477 dprintk("NFS reply mkdir: %d\n", status); 478 dprintk("NFS reply mkdir: %d\n", status);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 39b24041a4c7..3489015950b4 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -336,7 +336,7 @@ extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
336extern void nfs_zap_caches(struct inode *); 336extern void nfs_zap_caches(struct inode *);
337extern void nfs_invalidate_atime(struct inode *); 337extern void nfs_invalidate_atime(struct inode *);
338extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 338extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
339 struct nfs_fattr *); 339 struct nfs_fattr *, struct nfs4_label *);
340extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); 340extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
341extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 341extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
342extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 342extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
@@ -468,7 +468,8 @@ extern const struct file_operations nfs_dir_operations;
468extern const struct dentry_operations nfs_dentry_operations; 468extern const struct dentry_operations nfs_dentry_operations;
469 469
470extern void nfs_force_lookup_revalidate(struct inode *dir); 470extern void nfs_force_lookup_revalidate(struct inode *dir);
471extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); 471extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
472 struct nfs_fattr *fattr, struct nfs4_label *label);
472extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags); 473extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags);
473extern void nfs_access_zap_cache(struct inode *inode); 474extern void nfs_access_zap_cache(struct inode *inode);
474 475
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index d799b9f86820..ed31ba7a6f9e 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1378,11 +1378,12 @@ struct nfs_rpc_ops {
1378 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *, 1378 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1379 struct nfs_subversion *); 1379 struct nfs_subversion *);
1380 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1380 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1381 struct nfs_fattr *); 1381 struct nfs_fattr *, struct nfs4_label *);
1382 int (*setattr) (struct dentry *, struct nfs_fattr *, 1382 int (*setattr) (struct dentry *, struct nfs_fattr *,
1383 struct iattr *); 1383 struct iattr *);
1384 int (*lookup) (struct inode *, struct qstr *, 1384 int (*lookup) (struct inode *, struct qstr *,
1385 struct nfs_fh *, struct nfs_fattr *); 1385 struct nfs_fh *, struct nfs_fattr *,
1386 struct nfs4_label *);
1386 int (*access) (struct inode *, struct nfs_access_entry *); 1387 int (*access) (struct inode *, struct nfs_access_entry *);
1387 int (*readlink)(struct inode *, struct page *, unsigned int, 1388 int (*readlink)(struct inode *, struct page *, unsigned int,
1388 unsigned int); 1389 unsigned int);