]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: change svc_pool::sp_flags bits to enum
authorNeilBrown <neilb@suse.de>
Sat, 29 Jul 2023 18:33:05 +0000 (14:33 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 29 Aug 2023 21:45:22 +0000 (17:45 -0400)
When a sequence of numbers are needed for internal-use only, an enum is
typically best.  The sequence will inevitably need to be changed one
day, and having an enum means the developer doesn't need to think about
renumbering after insertion or deletion.  Such patches will be easier
to review.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/svc.h

index b206fdde8e97a7c4d06aeb7c81c154fbd1e05e7d..dc526240de5ea521393c30865c3d4c79218a524d 100644 (file)
@@ -42,12 +42,16 @@ struct svc_pool {
        struct percpu_counter   sp_sockets_queued;
        struct percpu_counter   sp_threads_woken;
 
-#define        SP_TASK_PENDING         (0)             /* still work to do even if no
-                                                * xprt is queued. */
-#define SP_CONGESTED           (1)
        unsigned long           sp_flags;
 } ____cacheline_aligned_in_smp;
 
+/* bits for sp_flags */
+enum {
+       SP_TASK_PENDING,        /* still work to do even if no xprt is queued */
+       SP_CONGESTED,           /* all threads are busy, none idle */
+};
+
+
 /*
  * RPC service.
  *