mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 22:08:18 +00:00
SUNRPC: Return true/false (not 1/0) from bool functions
[ Upstream commit5f7b839d47
] Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./fs/nfsd/nfs2acl.c:289:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_accessres' with return type bool ./fs/nfsd/nfs2acl.c:252:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_getaclres' with return type bool Signed-off-by: Haowen Bai <baihaowen@meizu.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Stable-dep-of:ea5021e911
("NFSD: Finish converting the NFSv2 GETACL result encoder") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f9cbeff794
commit
3f9dbee1ee
1 changed files with 12 additions and 12 deletions
|
@ -249,34 +249,34 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
if (!svcxdr_encode_stat(xdr, resp->status))
|
if (!svcxdr_encode_stat(xdr, resp->status))
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
if (dentry == NULL || d_really_is_negative(dentry))
|
if (dentry == NULL || d_really_is_negative(dentry))
|
||||||
return 1;
|
return true;
|
||||||
inode = d_inode(dentry);
|
inode = d_inode(dentry);
|
||||||
|
|
||||||
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
|
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
|
||||||
return 0;
|
return false;
|
||||||
if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
|
if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
rqstp->rq_res.page_len = w = nfsacl_size(
|
rqstp->rq_res.page_len = w = nfsacl_size(
|
||||||
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
|
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
|
||||||
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
|
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
|
||||||
while (w > 0) {
|
while (w > 0) {
|
||||||
if (!*(rqstp->rq_next_page++))
|
if (!*(rqstp->rq_next_page++))
|
||||||
return 1;
|
return true;
|
||||||
w -= PAGE_SIZE;
|
w -= PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
|
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
|
||||||
resp->mask & NFS_ACL, 0))
|
resp->mask & NFS_ACL, 0))
|
||||||
return 0;
|
return false;
|
||||||
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default,
|
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default,
|
||||||
resp->mask & NFS_DFACL, NFS_ACL_DEFAULT))
|
resp->mask & NFS_DFACL, NFS_ACL_DEFAULT))
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACCESS */
|
/* ACCESS */
|
||||||
|
@ -286,17 +286,17 @@ static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
|
||||||
struct nfsd3_accessres *resp = rqstp->rq_resp;
|
struct nfsd3_accessres *resp = rqstp->rq_resp;
|
||||||
|
|
||||||
if (!svcxdr_encode_stat(xdr, resp->status))
|
if (!svcxdr_encode_stat(xdr, resp->status))
|
||||||
return 0;
|
return false;
|
||||||
switch (resp->status) {
|
switch (resp->status) {
|
||||||
case nfs_ok:
|
case nfs_ok:
|
||||||
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
|
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
|
||||||
return 0;
|
return false;
|
||||||
if (xdr_stream_encode_u32(xdr, resp->access) < 0)
|
if (xdr_stream_encode_u32(xdr, resp->access) < 0)
|
||||||
return 0;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue