Skip to content

Commit 3275694

Browse files
neilbrownchucklever
authored andcommitted
SUNRPC: change svc_pool::sp_flags bits to enum
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>
1 parent ba4bba6 commit 3275694

File tree

1 file changed

+7
-3
lines changed
  • include/linux/sunrpc

1 file changed

+7
-3
lines changed

include/linux/sunrpc/svc.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ struct svc_pool {
4242
struct percpu_counter sp_sockets_queued;
4343
struct percpu_counter sp_threads_woken;
4444

45-
#define SP_TASK_PENDING (0) /* still work to do even if no
46-
* xprt is queued. */
47-
#define SP_CONGESTED (1)
4845
unsigned long sp_flags;
4946
} ____cacheline_aligned_in_smp;
5047

48+
/* bits for sp_flags */
49+
enum {
50+
SP_TASK_PENDING, /* still work to do even if no xprt is queued */
51+
SP_CONGESTED, /* all threads are busy, none idle */
52+
};
53+
54+
5155
/*
5256
* RPC service.
5357
*

0 commit comments

Comments
 (0)