Commit e1290b3e authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o

ext4: Remove unnecessary wait_event ext4_run_lazyinit_thread()

For some reason we have been waiting for lazyinit thread to start in the
ext4_run_lazyinit_thread() but it is not needed since it was jus
unnecessary complexity, so get rid of it. We can also remove li_task and
li_wait_task since it is not used anymore.
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
parent 4ed5c033
...@@ -1605,8 +1605,6 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, ...@@ -1605,8 +1605,6 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
*/ */
struct ext4_lazy_init { struct ext4_lazy_init {
unsigned long li_state; unsigned long li_state;
wait_queue_head_t li_wait_task;
struct task_struct *li_task;
struct list_head li_request_list; struct list_head li_request_list;
struct mutex li_list_mtx; struct mutex li_list_mtx;
}; };
......
...@@ -2768,9 +2768,6 @@ static int ext4_lazyinit_thread(void *arg) ...@@ -2768,9 +2768,6 @@ static int ext4_lazyinit_thread(void *arg)
BUG_ON(NULL == eli); BUG_ON(NULL == eli);
eli->li_task = current;
wake_up(&eli->li_wait_task);
cont_thread: cont_thread:
while (true) { while (true) {
next_wakeup = MAX_JIFFY_OFFSET; next_wakeup = MAX_JIFFY_OFFSET;
...@@ -2833,9 +2830,6 @@ static int ext4_lazyinit_thread(void *arg) ...@@ -2833,9 +2830,6 @@ static int ext4_lazyinit_thread(void *arg)
goto cont_thread; goto cont_thread;
} }
mutex_unlock(&eli->li_list_mtx); mutex_unlock(&eli->li_list_mtx);
eli->li_task = NULL;
wake_up(&eli->li_wait_task);
kfree(ext4_li_info); kfree(ext4_li_info);
ext4_li_info = NULL; ext4_li_info = NULL;
mutex_unlock(&ext4_li_mtx); mutex_unlock(&ext4_li_mtx);
...@@ -2872,8 +2866,6 @@ static int ext4_run_lazyinit_thread(void) ...@@ -2872,8 +2866,6 @@ static int ext4_run_lazyinit_thread(void)
return err; return err;
} }
ext4_li_info->li_state |= EXT4_LAZYINIT_RUNNING; ext4_li_info->li_state |= EXT4_LAZYINIT_RUNNING;
wait_event(ext4_li_info->li_wait_task, ext4_li_info->li_task != NULL);
return 0; return 0;
} }
...@@ -2908,11 +2900,9 @@ static int ext4_li_info_new(void) ...@@ -2908,11 +2900,9 @@ static int ext4_li_info_new(void)
if (!eli) if (!eli)
return -ENOMEM; return -ENOMEM;
eli->li_task = NULL;
INIT_LIST_HEAD(&eli->li_request_list); INIT_LIST_HEAD(&eli->li_request_list);
mutex_init(&eli->li_list_mtx); mutex_init(&eli->li_list_mtx);
init_waitqueue_head(&eli->li_wait_task);
eli->li_state |= EXT4_LAZYINIT_QUIT; eli->li_state |= EXT4_LAZYINIT_QUIT;
ext4_li_info = eli; ext4_li_info = eli;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment