Skip to content

Commit 1e2f67d

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFS: Remove the nfs4_label argument from decode_getattr_*() functions
Wa can check if the fattr has an allocated label when needed Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent dd225cb commit 1e2f67d

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

fs/nfs/nfs4xdr.c

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4585,8 +4585,7 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr,
45854585

45864586
static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
45874587
struct nfs_fattr *fattr, struct nfs_fh *fh,
4588-
struct nfs4_fs_locations *fs_loc, struct nfs4_label *label,
4589-
const struct nfs_server *server)
4588+
struct nfs4_fs_locations *fs_loc, const struct nfs_server *server)
45904589
{
45914590
int status;
45924591
umode_t fmode = 0;
@@ -4701,8 +4700,8 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
47014700
if (status < 0)
47024701
goto xdr_error;
47034702

4704-
if (label) {
4705-
status = decode_attr_security_label(xdr, bitmap, label);
4703+
if (fattr->label) {
4704+
status = decode_attr_security_label(xdr, bitmap, fattr->label);
47064705
if (status < 0)
47074706
goto xdr_error;
47084707
fattr->valid |= status;
@@ -4715,7 +4714,7 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
47154714

47164715
static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr,
47174716
struct nfs_fh *fh, struct nfs4_fs_locations *fs_loc,
4718-
struct nfs4_label *label, const struct nfs_server *server)
4717+
const struct nfs_server *server)
47194718
{
47204719
unsigned int savep;
47214720
uint32_t attrlen,
@@ -4734,8 +4733,7 @@ static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fat
47344733
if (status < 0)
47354734
goto xdr_error;
47364735

4737-
status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, fs_loc,
4738-
label, server);
4736+
status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, fs_loc, server);
47394737
if (status < 0)
47404738
goto xdr_error;
47414739

@@ -4745,16 +4743,10 @@ static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fat
47454743
return status;
47464744
}
47474745

4748-
static int decode_getfattr_label(struct xdr_stream *xdr, struct nfs_fattr *fattr,
4749-
struct nfs4_label *label, const struct nfs_server *server)
4750-
{
4751-
return decode_getfattr_generic(xdr, fattr, NULL, NULL, label, server);
4752-
}
4753-
47544746
static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr,
47554747
const struct nfs_server *server)
47564748
{
4757-
return decode_getfattr_generic(xdr, fattr, NULL, NULL, NULL, server);
4749+
return decode_getfattr_generic(xdr, fattr, NULL, NULL, server);
47584750
}
47594751

47604752
/*
@@ -6171,7 +6163,7 @@ static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
61716163
status = decode_getfh(xdr, res->fh);
61726164
if (status)
61736165
goto out;
6174-
status = decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6166+
status = decode_getfattr(xdr, res->fattr, res->server);
61756167
out:
61766168
return status;
61776169
}
@@ -6201,7 +6193,7 @@ static int nfs4_xdr_dec_lookupp(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
62016193
status = decode_getfh(xdr, res->fh);
62026194
if (status)
62036195
goto out;
6204-
status = decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6196+
status = decode_getfattr(xdr, res->fattr, res->server);
62056197
out:
62066198
return status;
62076199
}
@@ -6228,8 +6220,7 @@ static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp,
62286220
goto out;
62296221
status = decode_getfh(xdr, res->fh);
62306222
if (status == 0)
6231-
status = decode_getfattr_label(xdr, res->fattr,
6232-
res->fattr->label, res->server);
6223+
status = decode_getfattr(xdr, res->fattr, res->server);
62336224
out:
62346225
return status;
62356226
}
@@ -6323,7 +6314,7 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
63236314
status = decode_restorefh(xdr);
63246315
if (status)
63256316
goto out;
6326-
decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6317+
decode_getfattr(xdr, res->fattr, res->server);
63276318
out:
63286319
return status;
63296320
}
@@ -6353,7 +6344,7 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
63536344
status = decode_getfh(xdr, res->fh);
63546345
if (status)
63556346
goto out;
6356-
decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6347+
decode_getfattr(xdr, res->fattr, res->server);
63576348
out:
63586349
return status;
63596350
}
@@ -6386,7 +6377,7 @@ static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
63866377
status = decode_putfh(xdr);
63876378
if (status)
63886379
goto out;
6389-
status = decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6380+
status = decode_getfattr(xdr, res->fattr, res->server);
63906381
out:
63916382
return status;
63926383
}
@@ -6524,7 +6515,7 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
65246515
goto out;
65256516
if (res->access_request)
65266517
decode_access(xdr, &res->access_supported, &res->access_result);
6527-
decode_getfattr_label(xdr, res->f_attr, res->f_attr->label, res->server);
6518+
decode_getfattr(xdr, res->f_attr, res->server);
65286519
if (res->lg_res)
65296520
decode_layoutget(xdr, rqstp, res->lg_res);
65306521
out:
@@ -6608,7 +6599,7 @@ static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp,
66086599
status = decode_setattr(xdr);
66096600
if (status)
66106601
goto out;
6611-
decode_getfattr_label(xdr, res->fattr, res->fattr->label, res->server);
6602+
decode_getfattr(xdr, res->fattr, res->server);
66126603
out:
66136604
return status;
66146605
}
@@ -7023,7 +7014,7 @@ static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req,
70237014
status = decode_getfattr_generic(xdr,
70247015
&res->fs_locations->fattr,
70257016
NULL, res->fs_locations,
7026-
NULL, res->fs_locations->server);
7017+
res->fs_locations->server);
70277018
if (status)
70287019
goto out;
70297020
if (res->renew)
@@ -7036,7 +7027,7 @@ static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req,
70367027
status = decode_getfattr_generic(xdr,
70377028
&res->fs_locations->fattr,
70387029
NULL, res->fs_locations,
7039-
NULL, res->fs_locations->server);
7030+
res->fs_locations->server);
70407031
}
70417032
out:
70427033
return status;
@@ -7467,7 +7458,7 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
74677458
return -EAGAIN;
74687459

74697460
if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
7470-
NULL, entry->fattr->label, entry->server) < 0)
7461+
NULL, entry->server) < 0)
74717462
return -EAGAIN;
74727463
if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
74737464
entry->ino = entry->fattr->mounted_on_fileid;

0 commit comments

Comments
 (0)