Skip to content

Commit 05a45a2

Browse files
jtlaytonJ. Bruce Fields
authored andcommitted
sunrpc: turn bitfield flags in svc_version into bools
It's just simpler to read this way, IMO. Also, no need to explicitly set vs_hidden to false in the nfsacl ones. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 4ab495b commit 05a45a2

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

fs/nfs/callback_xdr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ struct svc_version nfs4_callback_version1 = {
10831083
.vs_proc = nfs4_callback_procedures1,
10841084
.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
10851085
.vs_dispatch = NULL,
1086-
.vs_hidden = 1,
1086+
.vs_hidden = true,
10871087
};
10881088

10891089
struct svc_version nfs4_callback_version4 = {
@@ -1092,5 +1092,5 @@ struct svc_version nfs4_callback_version4 = {
10921092
.vs_proc = nfs4_callback_procedures1,
10931093
.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
10941094
.vs_dispatch = NULL,
1095-
.vs_hidden = 1,
1095+
.vs_hidden = true,
10961096
};

fs/nfsd/nfs2acl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,5 +376,4 @@ struct svc_version nfsd_acl_version2 = {
376376
.vs_proc = nfsd_acl_procedures2,
377377
.vs_dispatch = nfsd_dispatch,
378378
.vs_xdrsize = NFS3_SVC_XDRSIZE,
379-
.vs_hidden = 0,
380379
};

fs/nfsd/nfs3acl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,5 @@ struct svc_version nfsd_acl_version3 = {
266266
.vs_proc = nfsd_acl_procedures3,
267267
.vs_dispatch = nfsd_dispatch,
268268
.vs_xdrsize = NFS3_SVC_XDRSIZE,
269-
.vs_hidden = 0,
270269
};
271270

fs/nfsd/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ struct svc_version nfsd_version4 = {
25422542
.vs_proc = nfsd_procedures4,
25432543
.vs_dispatch = nfsd_dispatch,
25442544
.vs_xdrsize = NFS4_SVC_XDRSIZE,
2545-
.vs_rpcb_optnl = 1,
2545+
.vs_rpcb_optnl = true,
25462546
};
25472547

25482548
/*

include/linux/sunrpc/svc.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,11 @@ struct svc_version {
400400
struct svc_procedure * vs_proc; /* per-procedure info */
401401
u32 vs_xdrsize; /* xdrsize needed for this version */
402402

403-
unsigned int vs_hidden : 1, /* Don't register with portmapper.
404-
* Only used for nfsacl so far. */
405-
vs_rpcb_optnl:1;/* Don't care the result of register.
406-
* Only used for nfsv4. */
403+
/* Don't register with rpcbind */
404+
bool vs_hidden;
405+
406+
/* Don't care if the rpcbind registration fails */
407+
bool vs_rpcb_optnl;
407408

408409
/* Override dispatch function (e.g. when caching replies).
409410
* A return value of 0 means drop the request.

net/sunrpc/svc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static int svc_uses_rpcbind(struct svc_serv *serv)
385385
for (i = 0; i < progp->pg_nvers; i++) {
386386
if (progp->pg_vers[i] == NULL)
387387
continue;
388-
if (progp->pg_vers[i]->vs_hidden == 0)
388+
if (!progp->pg_vers[i]->vs_hidden)
389389
return 1;
390390
}
391391
}

0 commit comments

Comments
 (0)