Skip to content

Commit 68be174

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Remove the nfs4_label from the nfs4_create_res struct
Instead, use the label embedded in the attached fattr. Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent b1db9a4 commit 68be174

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

fs/nfs/nfs4proc.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4850,7 +4850,6 @@ struct nfs4_createdata {
48504850
struct nfs4_create_res res;
48514851
struct nfs_fh fh;
48524852
struct nfs_fattr fattr;
4853-
struct nfs4_label *label;
48544853
};
48554854

48564855
static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
@@ -4862,8 +4861,8 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
48624861
if (data != NULL) {
48634862
struct nfs_server *server = NFS_SERVER(dir);
48644863

4865-
data->label = nfs4_label_alloc(server, GFP_KERNEL);
4866-
if (IS_ERR(data->label))
4864+
data->fattr.label = nfs4_label_alloc(server, GFP_KERNEL);
4865+
if (IS_ERR(data->fattr.label))
48674866
goto out_free;
48684867

48694868
data->msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CREATE];
@@ -4874,12 +4873,11 @@ static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
48744873
data->arg.name = name;
48754874
data->arg.attrs = sattr;
48764875
data->arg.ftype = ftype;
4877-
data->arg.bitmask = nfs4_bitmask(server, data->label);
4876+
data->arg.bitmask = nfs4_bitmask(server, data->fattr.label);
48784877
data->arg.umask = current_umask();
48794878
data->res.server = server;
48804879
data->res.fh = &data->fh;
48814880
data->res.fattr = &data->fattr;
4882-
data->res.label = data->label;
48834881
nfs_fattr_init(data->res.fattr);
48844882
}
48854883
return data;
@@ -4901,14 +4899,14 @@ static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_
49014899
data->res.fattr->time_start,
49024900
NFS_INO_INVALID_DATA);
49034901
spin_unlock(&dir->i_lock);
4904-
status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, data->res.label);
4902+
status = nfs_instantiate(dentry, data->res.fh, data->res.fattr, data->res.fattr->label);
49054903
}
49064904
return status;
49074905
}
49084906

49094907
static void nfs4_free_createdata(struct nfs4_createdata *data)
49104908
{
4911-
nfs4_label_free(data->label);
4909+
nfs4_label_free(data->fattr.label);
49124910
kfree(data);
49134911
}
49144912

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6353,7 +6353,7 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
63536353
status = decode_getfh(xdr, res->fh);
63546354
if (status)
63556355
goto out;
6356-
decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6356+
decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
63576357
out:
63586358
return status;
63596359
}

include/linux/nfs_xdr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,6 @@ struct nfs4_create_res {
10401040
const struct nfs_server * server;
10411041
struct nfs_fh * fh;
10421042
struct nfs_fattr * fattr;
1043-
struct nfs4_label *label;
10441043
struct nfs4_change_info dir_cinfo;
10451044
};
10461045

0 commit comments

Comments
 (0)