sunrpc: turn bitfield flags in svc_version into bools
authorJeff Layton <jlayton@redhat.com>
Fri, 24 Feb 2017 18:25:22 +0000 (13:25 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 24 Feb 2017 20:50:08 +0000 (15:50 -0500)
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>
fs/nfs/callback_xdr.c
fs/nfsd/nfs2acl.c
fs/nfsd/nfs3acl.c
fs/nfsd/nfs4proc.c
include/linux/sunrpc/svc.h
net/sunrpc/svc.c

index eb094c6011d85bb7ce7bd544a3d203defd50b03a..e9836f611d9c3cdc381b5da0679211cbfb03950f 100644 (file)
@@ -1083,7 +1083,7 @@ struct svc_version nfs4_callback_version1 = {
        .vs_proc = nfs4_callback_procedures1,
        .vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
        .vs_dispatch = NULL,
-       .vs_hidden = 1,
+       .vs_hidden = true,
 };
 
 struct svc_version nfs4_callback_version4 = {
@@ -1092,5 +1092,5 @@ struct svc_version nfs4_callback_version4 = {
        .vs_proc = nfs4_callback_procedures1,
        .vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
        .vs_dispatch = NULL,
-       .vs_hidden = 1,
+       .vs_hidden = true,
 };
index d08cd88155c75278c4607f49c078622bf87ab5ee..838f90f3f890a00f0f0989e5c3abb79e20b273d0 100644 (file)
@@ -376,5 +376,4 @@ struct svc_version  nfsd_acl_version2 = {
                .vs_proc        = nfsd_acl_procedures2,
                .vs_dispatch    = nfsd_dispatch,
                .vs_xdrsize     = NFS3_SVC_XDRSIZE,
-               .vs_hidden      = 0,
 };
index 0c890347cde3d9559b0b0103c2c2c11825d51fae..dcb5f79076c0cb3cb12400575cb7e3d3cfa9e26d 100644 (file)
@@ -266,6 +266,5 @@ struct svc_version  nfsd_acl_version3 = {
                .vs_proc        = nfsd_acl_procedures3,
                .vs_dispatch    = nfsd_dispatch,
                .vs_xdrsize     = NFS3_SVC_XDRSIZE,
-               .vs_hidden      = 0,
 };
 
index 02750a4c8770e31512653b25dc0baba9b3463159..89e582fa58cd1bd187f05fd51caf34703ff1c463 100644 (file)
@@ -2542,7 +2542,7 @@ struct svc_version        nfsd_version4 = {
                .vs_proc        = nfsd_procedures4,
                .vs_dispatch    = nfsd_dispatch,
                .vs_xdrsize     = NFS4_SVC_XDRSIZE,
-               .vs_rpcb_optnl  = 1,
+               .vs_rpcb_optnl  = true,
 };
 
 /*
index 7321ae933867566013a250623564d722d2800305..96467c95f02e81cb347ed09f4d97b22472387aa3 100644 (file)
@@ -400,10 +400,11 @@ struct svc_version {
        struct svc_procedure *  vs_proc;        /* per-procedure info */
        u32                     vs_xdrsize;     /* xdrsize needed for this version */
 
-       unsigned int            vs_hidden : 1,  /* Don't register with portmapper.
-                                                * Only used for nfsacl so far. */
-                               vs_rpcb_optnl:1;/* Don't care the result of register.
-                                                * Only used for nfsv4. */
+       /* Don't register with rpcbind */
+       bool                    vs_hidden;
+
+       /* Don't care if the rpcbind registration fails */
+       bool                    vs_rpcb_optnl;
 
        /* Override dispatch function (e.g. when caching replies).
         * A return value of 0 means drop the request. 
index 75f290bddca1bbfd5c8a9db9bab1ac3d231f9ada..85bcdea67a3f7ca12bda0c9321c0d44544aa0482 100644 (file)
@@ -385,7 +385,7 @@ static int svc_uses_rpcbind(struct svc_serv *serv)
                for (i = 0; i < progp->pg_nvers; i++) {
                        if (progp->pg_vers[i] == NULL)
                                continue;
-                       if (progp->pg_vers[i]->vs_hidden == 0)
+                       if (!progp->pg_vers[i]->vs_hidden)
                                return 1;
                }
        }