struct admin_service *next, *prev; /* Client's list of services */
} admin_service;
+typedef struct admin_svcop {
+ admin_bgop bg; /* Background operation header */
+ struct admin *prov; /* Client servicing this job */
+ unsigned short index; /* This job's index */
+ struct admin_svcop *next, *prev; /* Links for provider's jobs */
+} admin_svcop;
+
+typedef struct admin_jobentry {
+ unsigned short seq; /* Zero if unused */
+ union {
+ admin_svcop *op; /* Operation, if slot in use, ... */
+ uint32 next; /* ... or index of next free slot */
+ } u;
+} admin_jobentry;
+
+typedef struct admin_jobtable {
+ uint32 n, sz; /* Used slots and table size */
+ admin_svcop *active; /* List of active jobs */
+ uint32 free; /* Index of first free slot */
+ admin_jobentry *v; /* And the big array of entries */
+} admin_jobtable;
+
typedef struct admin {
struct admin *next, *prev; /* Links to next and previous */
unsigned f; /* Various useful flags */
oqueue delay; /* Delayed output buffer list */
admin_bgop *bg; /* Backgrounded operations */
admin_service *svcs; /* Which services I provide */
+ admin_jobtable j; /* Table of outstanding jobs */
selbuf b; /* Line buffer for commands */
sel_file w; /* Selector for write buffering */
} admin;