mirror of
https://github.com/schoebel/mars
synced 2025-04-18 05:05:34 +00:00
all: s/light_(worker|checker)/main_\1/g
This commit is contained in:
parent
fedb9a93b3
commit
42a8bfaa60
@ -446,7 +446,7 @@ int handler_thread(void *data)
|
|||||||
if (unlikely(!cmd.cmd_str1))
|
if (unlikely(!cmd.cmd_str1))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
status = mars_dent_work(&handler_global, "/mars", sizeof(struct mars_dent), light_checker, dummy_worker, &handler_global, 3);
|
status = mars_dent_work(&handler_global, "/mars", sizeof(struct mars_dent), main_checker, dummy_worker, &handler_global, 3);
|
||||||
|
|
||||||
down(&brick->socket_sem);
|
down(&brick->socket_sem);
|
||||||
status = mars_send_dent_list(sock, &handler_global.dent_anchor);
|
status = mars_send_dent_list(sock, &handler_global.dent_anchor);
|
||||||
|
@ -433,7 +433,7 @@ int compute_emergency_mode(void)
|
|||||||
|
|
||||||
static struct task_struct *main_thread = NULL;
|
static struct task_struct *main_thread = NULL;
|
||||||
|
|
||||||
typedef int (*light_worker_fn)(void *buf, struct mars_dent *dent);
|
typedef int (*main_worker_fn)(void *buf, struct mars_dent *dent);
|
||||||
|
|
||||||
struct light_class {
|
struct light_class {
|
||||||
char *cl_name;
|
char *cl_name;
|
||||||
@ -443,9 +443,9 @@ struct light_class {
|
|||||||
bool cl_serial;
|
bool cl_serial;
|
||||||
bool cl_use_channel;
|
bool cl_use_channel;
|
||||||
int cl_father;
|
int cl_father;
|
||||||
light_worker_fn cl_prepare;
|
main_worker_fn cl_prepare;
|
||||||
light_worker_fn cl_forward;
|
main_worker_fn cl_forward;
|
||||||
light_worker_fn cl_backward;
|
main_worker_fn cl_backward;
|
||||||
};
|
};
|
||||||
|
|
||||||
// the order is important!
|
// the order is important!
|
||||||
@ -5349,7 +5349,7 @@ static const struct light_class light_classes[] = {
|
|||||||
|
|
||||||
/* Helper routine to pre-determine the relevance of a name from the filesystem.
|
/* Helper routine to pre-determine the relevance of a name from the filesystem.
|
||||||
*/
|
*/
|
||||||
int light_checker(struct mars_dent *parent, const char *_name, int namlen, unsigned int d_type, int *prefix, int *serial, bool *use_channel)
|
int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsigned int d_type, int *prefix, int *serial, bool *use_channel)
|
||||||
{
|
{
|
||||||
int class;
|
int class;
|
||||||
int status = -2;
|
int status = -2;
|
||||||
@ -5427,9 +5427,9 @@ int light_checker(struct mars_dent *parent, const char *_name, int namlen, unsig
|
|||||||
/* Do some syntactic checks, then delegate work to the real worker functions
|
/* Do some syntactic checks, then delegate work to the real worker functions
|
||||||
* from the light_classes[] table.
|
* from the light_classes[] table.
|
||||||
*/
|
*/
|
||||||
static int light_worker(struct mars_global *global, struct mars_dent *dent, bool prepare, bool direction)
|
static int main_worker(struct mars_global *global, struct mars_dent *dent, bool prepare, bool direction)
|
||||||
{
|
{
|
||||||
light_worker_fn worker;
|
main_worker_fn worker;
|
||||||
int class = dent->d_class;
|
int class = dent->d_class;
|
||||||
|
|
||||||
if (class < 0 || class >= sizeof(light_classes)/sizeof(struct light_class)) {
|
if (class < 0 || class >= sizeof(light_classes)/sizeof(struct light_class)) {
|
||||||
@ -5542,7 +5542,7 @@ static int light_thread(void *data)
|
|||||||
|
|
||||||
MARS_DBG("-------- start worker ---------\n");
|
MARS_DBG("-------- start worker ---------\n");
|
||||||
_global.deleted_min = 0;
|
_global.deleted_min = 0;
|
||||||
status = mars_dent_work(&_global, "/mars", sizeof(struct mars_dent), light_checker, light_worker, &_global, 3);
|
status = mars_dent_work(&_global, "/mars", sizeof(struct mars_dent), main_checker, main_worker, &_global, 3);
|
||||||
_global.deleted_border = _global.deleted_min;
|
_global.deleted_border = _global.deleted_min;
|
||||||
MARS_DBG("-------- worker deleted_min = %d status = %d\n", _global.deleted_min, status);
|
MARS_DBG("-------- worker deleted_min = %d status = %d\n", _global.deleted_min, status);
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ extern int mars_max_loadavg;
|
|||||||
|
|
||||||
extern int mars_mem_percent;
|
extern int mars_mem_percent;
|
||||||
|
|
||||||
extern int light_checker(struct mars_dent *parent, const char *_name, int namlen, unsigned int d_type, int *prefix, int *serial, bool *use_channel);
|
extern int main_checker(struct mars_dent *parent, const char *_name, int namlen, unsigned int d_type, int *prefix, int *serial, bool *use_channel);
|
||||||
|
|
||||||
void from_remote_trigger(void);
|
void from_remote_trigger(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user