extern int pid; /* current process id */
extern int relative_pid; /* process id starting at 1 */
extern unsigned long pid_bit; /* bit corresponding to the process id */
+extern unsigned long all_proc_mask; /* mask of all processes */
extern int actconn; /* # of active sessions */
extern int listeners;
extern int jobs; /* # of active jobs (listeners, sessions, open devices) */
*/
nbproc = my_popcountl(curproxy->bind_proc);
- curproxy->bind_proc &= nbits(global.nbproc);
+ curproxy->bind_proc &= all_proc_mask;
if (!curproxy->bind_proc && nbproc == 1) {
ha_warning("Proxy '%s': the process specified on the 'bind-process' directive refers to a process number that is higher than global.nbproc. The proxy has been forced to run on process 1 only.\n", curproxy->id);
curproxy->bind_proc = 1;
if (!bind_conf->bind_proc)
continue;
- mask = nbits(global.nbproc);
+ mask = all_proc_mask;
if (curproxy->bind_proc)
mask &= curproxy->bind_proc;
/* mask cannot be null here thanks to the previous checks */
list_for_each_entry(bind_conf, &global.stats_fe->conf.bind, by_fe) {
unsigned long mask;
- mask = nbits(global.nbproc);
+ mask = all_proc_mask;
if (global.stats_fe->bind_proc)
mask &= global.stats_fe->bind_proc;
list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
unsigned long mask;
- mask = bind_conf->bind_proc ? bind_conf->bind_proc : nbits(global.nbproc);
+ mask = bind_conf->bind_proc ? bind_conf->bind_proc : all_proc_mask;
curproxy->bind_proc |= mask;
}
if (!curproxy->bind_proc)
- curproxy->bind_proc = nbits(global.nbproc);
+ curproxy->bind_proc = all_proc_mask;
}
if (global.stats_fe) {
global.stats_fe->bind_proc |= mask;
}
if (!global.stats_fe->bind_proc)
- global.stats_fe->bind_proc = nbits(global.nbproc);
+ global.stats_fe->bind_proc = all_proc_mask;
}
/* propagate bindings from frontends to backends. Don't do it if there
for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
if (curproxy->bind_proc)
continue;
- curproxy->bind_proc = nbits(global.nbproc);
+ curproxy->bind_proc = all_proc_mask;
}
/*******************************************************/
nbproc = my_popcountl(curproxy->bind_proc &
(listener->bind_conf->bind_proc ? listener->bind_conf->bind_proc : curproxy->bind_proc) &
- nbits(global.nbproc));
+ all_proc_mask);
if (!nbproc) /* no intersection between listener and frontend */
nbproc = 1;
bind_conf->xprt->destroy_bind_conf(bind_conf);
}
- if (atleast2(curproxy->bind_proc & nbits(global.nbproc))) {
+ if (atleast2(curproxy->bind_proc & all_proc_mask)) {
if (curproxy->uri_auth) {
int count, maxproc = 0;