all: earlier rot destruction

This commit is contained in:
Thomas Schoebel-Theuer 2020-09-15 10:33:37 +02:00 committed by Thomas Schoebel-Theuer
parent f9f2a421b8
commit efbb44cf4b
2 changed files with 18 additions and 6 deletions

View File

@ -7001,6 +7001,17 @@ done:
mars_remote_trigger(MARS_TRIGGER_TO_REMOTE);
brick_msleep(1000);
down_write(&rot_sem);
while (!list_empty(&rot_anchor)) {
struct mars_rotate *rot;
rot = container_of(rot_anchor.next, struct mars_rotate, rot_head);
up_write(&rot_sem);
rot_destruct(rot);
down_write(&rot_sem);
}
up_write(&rot_sem);
mars_free_dent_all(mars_global, &mars_global->dent_anchor);
mars_kill_brick_all(mars_global, &mars_global->brick_anchor, false);

View File

@ -2402,6 +2402,13 @@ void mars_free_dent(struct mars_global *global, struct mars_dent *dent)
free_mars_global(dent->d_subtree);
}
if (dent->d_private) {
if (dent->d_private_destruct) {
dent->d_private_destruct(dent->d_private);
}
brick_mem_free(dent->d_private);
}
for (i = 0; i < MARS_ARGV_MAX; i++) {
brick_string_free(dent->d_argv[i]);
}
@ -2413,12 +2420,6 @@ void mars_free_dent(struct mars_global *global, struct mars_dent *dent)
brick_string_free(dent->new_link);
if (dent->d_parent)
dent->d_parent->d_child_count--;
if (dent->d_private) {
if (dent->d_private_destruct) {
dent->d_private_destruct(dent->d_private);
}
brick_mem_free(dent->d_private);
}
brick_mem_free(dent);
}
EXPORT_SYMBOL_GPL(mars_free_dent);