mirror of
https://github.com/schoebel/mars
synced 2025-02-21 14:56:55 +00:00
infra: simplify mars_kill_brick_when_possible()
This commit is contained in:
parent
a03d9dbad4
commit
333760bc1a
@ -407,7 +407,6 @@ int handler_thread(void *data)
|
||||
}
|
||||
|
||||
status = mars_kill_brick_when_possible(handler_global,
|
||||
&handler_global->brick_anchor,
|
||||
false, NULL, true);
|
||||
MARS_DBG("kill handler bricks (when possible) = %d\n", status);
|
||||
}
|
||||
@ -854,7 +853,6 @@ static int _server_thread(void *data)
|
||||
show_statistics(server_global, "server");
|
||||
|
||||
status = mars_kill_brick_when_possible(server_global,
|
||||
&server_global->brick_anchor,
|
||||
false, NULL, true);
|
||||
MARS_DBG("kill server bricks (when possible) = %d\n", status);
|
||||
|
||||
|
@ -6336,30 +6336,24 @@ static int _main_thread(void *data)
|
||||
|
||||
if (!mars_global->global_power.button) {
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, (void*)©_brick_type, true);
|
||||
MARS_DBG("kill copy bricks (when possible) = %d\n", status);
|
||||
}
|
||||
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, NULL, false);
|
||||
MARS_DBG("kill main bricks (when possible) = %d\n", status);
|
||||
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, (void*)&client_brick_type, true);
|
||||
MARS_DBG("kill client bricks (when possible) = %d\n", status);
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, (void*)&aio_brick_type, true);
|
||||
MARS_DBG("kill aio bricks (when possible) = %d\n", status);
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, (void*)&sio_brick_type, true);
|
||||
MARS_DBG("kill sio bricks (when possible) = %d\n", status);
|
||||
status = mars_kill_brick_when_possible(mars_global,
|
||||
&mars_global->brick_anchor,
|
||||
false, (void*)&bio_brick_type, true);
|
||||
MARS_DBG("kill bio bricks (when possible) = %d\n", status);
|
||||
|
||||
|
@ -169,7 +169,10 @@ extern struct mars_brick *mars_make_brick(struct mars_global *global, struct mar
|
||||
extern int mars_free_brick(struct mars_brick *brick);
|
||||
extern int mars_kill_brick(struct mars_brick *brick);
|
||||
extern int mars_kill_brick_all(struct mars_global *global, struct list_head *anchor, bool use_dent_link);
|
||||
extern int mars_kill_brick_when_possible(struct mars_global *global, struct list_head *anchor, bool use_dent_link, const struct mars_brick_type *type, bool even_on);
|
||||
extern int mars_kill_brick_when_possible(struct mars_global *global,
|
||||
bool use_dent_link,
|
||||
const struct mars_brick_type *type,
|
||||
bool even_on);
|
||||
|
||||
// mid-level brick instantiation (identity is based on path strings)
|
||||
|
||||
|
@ -2627,8 +2627,12 @@ done:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mars_kill_brick_all);
|
||||
|
||||
int mars_kill_brick_when_possible(struct mars_global *global, struct list_head *anchor, bool use_dent_link, const struct mars_brick_type *type, bool even_on)
|
||||
int mars_kill_brick_when_possible(struct mars_global *global,
|
||||
bool use_dent_link,
|
||||
const struct mars_brick_type *type,
|
||||
bool even_on)
|
||||
{
|
||||
struct list_head *anchor = &global->brick_anchor;
|
||||
int return_status = 0;
|
||||
struct list_head *tmp;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user