Skip to content

Commit 76baa2b

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Remove the f_label from the nfs4_opendata and nfs_openres
Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent ba4bc8d commit 76baa2b

File tree

4 files changed

+12
-27
lines changed

4 files changed

+12
-27
lines changed

fs/nfs/nfs4_fs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ struct nfs4_opendata {
234234
struct nfs4_string group_name;
235235
struct nfs4_label *a_label;
236236
struct nfs_fattr f_attr;
237-
struct nfs4_label *f_label;
238237
struct dentry *dir;
239238
struct dentry *dentry;
240239
struct nfs4_state_owner *owner;

fs/nfs/nfs4proc.c

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,6 @@ nfs4_map_atomic_open_claim(struct nfs_server *server,
13291329
static void nfs4_init_opendata_res(struct nfs4_opendata *p)
13301330
{
13311331
p->o_res.f_attr = &p->f_attr;
1332-
p->o_res.f_label = p->f_label;
13331332
p->o_res.seqid = p->o_arg.seqid;
13341333
p->c_res.seqid = p->c_arg.seqid;
13351334
p->o_res.server = p->o_arg.server;
@@ -1355,8 +1354,8 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
13551354
if (p == NULL)
13561355
goto err;
13571356

1358-
p->f_label = nfs4_label_alloc(server, gfp_mask);
1359-
if (IS_ERR(p->f_label))
1357+
p->f_attr.label = nfs4_label_alloc(server, gfp_mask);
1358+
if (IS_ERR(p->f_attr.label))
13601359
goto err_free_p;
13611360

13621361
p->a_label = nfs4_label_alloc(server, gfp_mask);
@@ -1434,7 +1433,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
14341433
err_free_label:
14351434
nfs4_label_free(p->a_label);
14361435
err_free_f:
1437-
nfs4_label_free(p->f_label);
1436+
nfs4_label_free(p->f_attr.label);
14381437
err_free_p:
14391438
kfree(p);
14401439
err:
@@ -1456,7 +1455,7 @@ static void nfs4_opendata_free(struct kref *kref)
14561455
nfs4_put_state_owner(p->owner);
14571456

14581457
nfs4_label_free(p->a_label);
1459-
nfs4_label_free(p->f_label);
1458+
nfs4_label_free(p->f_attr.label);
14601459

14611460
dput(p->dir);
14621461
dput(p->dentry);
@@ -2009,7 +2008,7 @@ nfs4_opendata_get_inode(struct nfs4_opendata *data)
20092008
if (!(data->f_attr.valid & NFS_ATTR_FATTR))
20102009
return ERR_PTR(-EAGAIN);
20112010
inode = nfs_fhget(data->dir->d_sb, &data->o_res.fh,
2012-
&data->f_attr, data->f_label);
2011+
&data->f_attr, data->f_attr.label);
20132012
break;
20142013
default:
20152014
inode = d_inode(data->dentry);
@@ -2709,7 +2708,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data,
27092708
if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) {
27102709
nfs4_sequence_free_slot(&o_res->seq_res);
27112710
nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr,
2712-
o_res->f_label, NULL);
2711+
o_res->f_attr->label, NULL);
27132712
}
27142713
return 0;
27152714
}
@@ -3125,7 +3124,6 @@ static int _nfs4_do_open(struct inode *dir,
31253124
enum open_claim_type4 claim = NFS4_OPEN_CLAIM_NULL;
31263125
struct iattr *sattr = c->sattr;
31273126
struct nfs4_label *label = c->label;
3128-
struct nfs4_label *olabel = NULL;
31293127
int status;
31303128

31313129
/* Protect against reboot recovery conflicts */
@@ -3148,19 +3146,11 @@ static int _nfs4_do_open(struct inode *dir,
31483146
if (opendata == NULL)
31493147
goto err_put_state_owner;
31503148

3151-
if (label) {
3152-
olabel = nfs4_label_alloc(server, GFP_KERNEL);
3153-
if (IS_ERR(olabel)) {
3154-
status = PTR_ERR(olabel);
3155-
goto err_opendata_put;
3156-
}
3157-
}
3158-
31593149
if (server->attr_bitmask[2] & FATTR4_WORD2_MDSTHRESHOLD) {
31603150
if (!opendata->f_attr.mdsthreshold) {
31613151
opendata->f_attr.mdsthreshold = pnfs_mdsthreshold_alloc();
31623152
if (!opendata->f_attr.mdsthreshold)
3163-
goto err_free_label;
3153+
goto err_opendata_put;
31643154
}
31653155
opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0];
31663156
}
@@ -3169,7 +3159,7 @@ static int _nfs4_do_open(struct inode *dir,
31693159

31703160
status = _nfs4_open_and_get_state(opendata, flags, ctx);
31713161
if (status != 0)
3172-
goto err_free_label;
3162+
goto err_opendata_put;
31733163
state = ctx->state;
31743164

31753165
if ((opendata->o_arg.open_flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) &&
@@ -3186,11 +3176,12 @@ static int _nfs4_do_open(struct inode *dir,
31863176
nfs_fattr_init(opendata->o_res.f_attr);
31873177
status = nfs4_do_setattr(state->inode, cred,
31883178
opendata->o_res.f_attr, sattr,
3189-
ctx, label, olabel);
3179+
ctx, label, opendata->o_res.f_attr->label);
31903180
if (status == 0) {
31913181
nfs_setattr_update_inode(state->inode, sattr,
31923182
opendata->o_res.f_attr);
3193-
nfs_setsecurity(state->inode, opendata->o_res.f_attr, olabel);
3183+
nfs_setsecurity(state->inode, opendata->o_res.f_attr,
3184+
opendata->o_res.f_attr->label);
31943185
}
31953186
sattr->ia_valid = ia_old;
31963187
}
@@ -3203,13 +3194,9 @@ static int _nfs4_do_open(struct inode *dir,
32033194
opendata->f_attr.mdsthreshold = NULL;
32043195
}
32053196

3206-
nfs4_label_free(olabel);
3207-
32083197
nfs4_opendata_put(opendata);
32093198
nfs4_put_state_owner(sp);
32103199
return 0;
3211-
err_free_label:
3212-
nfs4_label_free(olabel);
32133200
err_opendata_put:
32143201
nfs4_opendata_put(opendata);
32153202
err_put_state_owner:

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6524,7 +6524,7 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
65246524
goto out;
65256525
if (res->access_request)
65266526
decode_access(xdr, &res->access_supported, &res->access_result);
6527-
decode_getfattr_label(xdr, res->f_attr, res->f_label, res->server);
6527+
decode_getfattr_label(xdr, res->f_attr, res->f_attr->label, res->server);
65286528
if (res->lg_res)
65296529
decode_layoutget(xdr, rqstp, res->lg_res);
65306530
out:

include/linux/nfs_xdr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ struct nfs_openres {
488488
struct nfs4_change_info cinfo;
489489
__u32 rflags;
490490
struct nfs_fattr * f_attr;
491-
struct nfs4_label *f_label;
492491
struct nfs_seqid * seqid;
493492
const struct nfs_server *server;
494493
fmode_t delegation_type;

0 commit comments

Comments
 (0)