2019-12-25 03:12:49

by Zheng Bin

[permalink] [raw]
Subject: [PATCH 0/3] nfsd: use true,false for bool variable

zhengbin (3):
nfsd: use true,false for bool variable in vfs.c
nfsd: use true,false for bool variable in nfs4proc.c
nfsd: use true,false for bool variable in nfssvc.c

fs/nfsd/nfs4proc.c | 4 ++--
fs/nfsd/nfssvc.c | 6 +++---
fs/nfsd/vfs.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)

--
2.7.4


2019-12-25 03:12:49

by Zheng Bin

[permalink] [raw]
Subject: [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c

Fixes coccicheck warning:

fs/nfsd/vfs.c:1389:5-13: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/vfs.c:1398:5-13: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/vfs.c:1415:2-10: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
fs/nfsd/vfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index c0dc491..891e09f 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1386,7 +1386,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
&& d_inode(dchild)->i_atime.tv_sec == v_atime
&& d_inode(dchild)->i_size == 0 ) {
if (created)
- *created = 1;
+ *created = true;
break;
}
/* fall through */
@@ -1395,7 +1395,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
&& d_inode(dchild)->i_atime.tv_sec == v_atime
&& d_inode(dchild)->i_size == 0 ) {
if (created)
- *created = 1;
+ *created = true;
goto set_attr;
}
/* fall through */
@@ -1412,7 +1412,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
goto out_nfserr;
}
if (created)
- *created = 1;
+ *created = true;

nfsd_check_ignore_resizing(iap);

--
2.7.4

2019-12-25 03:12:49

by Zheng Bin

[permalink] [raw]
Subject: [PATCH 3/3] nfsd: use true,false for bool variable in nfssvc.c

Fixes coccicheck warning:

fs/nfsd/nfssvc.c:394:2-14: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfssvc.c:407:2-14: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfssvc.c:422:2-14: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
fs/nfsd/nfssvc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index e8bee8f..decfda0 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -391,7 +391,7 @@ static int nfsd_startup_net(int nrservs, struct net *net, const struct cred *cre
ret = lockd_up(net, cred);
if (ret)
goto out_socks;
- nn->lockd_up = 1;
+ nn->lockd_up = true;
}

ret = nfs4_state_start_net(net);
@@ -404,7 +404,7 @@ static int nfsd_startup_net(int nrservs, struct net *net, const struct cred *cre
out_lockd:
if (nn->lockd_up) {
lockd_down(net);
- nn->lockd_up = 0;
+ nn->lockd_up = false;
}
out_socks:
nfsd_shutdown_generic();
@@ -419,7 +419,7 @@ static void nfsd_shutdown_net(struct net *net)
nfs4_state_shutdown_net(net);
if (nn->lockd_up) {
lockd_down(net);
- nn->lockd_up = 0;
+ nn->lockd_up = false;
}
nn->nfsd_net_up = false;
nfsd_shutdown_generic();
--
2.7.4

2019-12-25 03:12:49

by Zheng Bin

[permalink] [raw]
Subject: [PATCH 2/3] nfsd: use true,false for bool variable in nfs4proc.c

Fixes coccicheck warning:

fs/nfsd/nfs4proc.c:235:1-18: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfs4proc.c:368:1-17: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
---
fs/nfsd/nfs4proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 4798667..d7d910e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -232,7 +232,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, stru
if (!*resfh)
return nfserr_jukebox;
fh_init(*resfh, NFS4_FHSIZE);
- open->op_truncate = 0;
+ open->op_truncate = false;

if (open->op_create) {
/* FIXME: check session persistence and pnfs flags.
@@ -365,7 +365,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL)
return nfserr_inval;

- open->op_created = 0;
+ open->op_created = false;
/*
* RFC5661 18.51.3
* Before RECLAIM_COMPLETE done, server should deny new lock
--
2.7.4

2020-01-03 16:24:45

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 0/3] nfsd: use true,false for bool variable

Thanks, applying for 5.6.--b.

On Wed, Dec 25, 2019 at 11:19:33AM +0800, zhengbin wrote:
> zhengbin (3):
> nfsd: use true,false for bool variable in vfs.c
> nfsd: use true,false for bool variable in nfs4proc.c
> nfsd: use true,false for bool variable in nfssvc.c
>
> fs/nfsd/nfs4proc.c | 4 ++--
> fs/nfsd/nfssvc.c | 6 +++---
> fs/nfsd/vfs.c | 6 +++---
> 3 files changed, 8 insertions(+), 8 deletions(-)
>
> --
> 2.7.4