Skip to content

Commit aa7ca3b

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Remove the nfs4_label from the nfs4_link_res struct
Again, use the fattr's label field instead. Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 68be174 commit aa7ca3b

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

fs/nfs/nfs4proc.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4790,7 +4790,6 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
47904790
};
47914791
struct nfs4_link_res res = {
47924792
.server = server,
4793-
.label = NULL,
47944793
};
47954794
struct rpc_message msg = {
47964795
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LINK],
@@ -4799,18 +4798,12 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
47994798
};
48004799
int status = -ENOMEM;
48014800

4802-
res.fattr = nfs_alloc_fattr();
4801+
res.fattr = nfs_alloc_fattr_with_label(server);
48034802
if (res.fattr == NULL)
48044803
goto out;
48054804

4806-
res.label = nfs4_label_alloc(server, GFP_KERNEL);
4807-
if (IS_ERR(res.label)) {
4808-
status = PTR_ERR(res.label);
4809-
goto out;
4810-
}
4811-
48124805
nfs4_inode_make_writeable(inode);
4813-
nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, res.label), inode,
4806+
nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, res.fattr->label), inode,
48144807
NFS_INO_INVALID_CHANGE);
48154808
status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1);
48164809
if (!status) {
@@ -4819,12 +4812,9 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
48194812
nfs4_inc_nlink(inode);
48204813
status = nfs_post_op_update_inode(inode, res.fattr);
48214814
if (!status)
4822-
nfs_setsecurity(inode, res.fattr, res.label);
4815+
nfs_setsecurity(inode, res.fattr, res.fattr->label);
48234816
}
48244817

4825-
4826-
nfs4_label_free(res.label);
4827-
48284818
out:
48294819
nfs_free_fattr(res.fattr);
48304820
return status;

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6323,7 +6323,7 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
63236323
status = decode_restorefh(xdr);
63246324
if (status)
63256325
goto out;
6326-
decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6326+
decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
63276327
out:
63286328
return status;
63296329
}

include/linux/nfs_xdr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,6 @@ struct nfs4_link_res {
10791079
struct nfs4_sequence_res seq_res;
10801080
const struct nfs_server * server;
10811081
struct nfs_fattr * fattr;
1082-
struct nfs4_label *label;
10831082
struct nfs4_change_info cinfo;
10841083
struct nfs_fattr * dir_attr;
10851084
};

0 commit comments

Comments
 (0)