提交 bc5511d0 编写于 作者: N Nikolay Borisov 提交者: David Sterba

btrfs: Use schedule_timeout_interruptible

Instead of manually fiddling with the state of the task
(RUNNING->INTERRUPTIBLE->RUNNING) again just use schedule_timeout_interruptible
which adjusts the task state as needed. No functional changes.
Signed-off-by: NNikolay Borisov <nborisov@suse.com>
Reviewed-by: NJosef Bacik <jbacik@fb.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 f9cacae3
...@@ -1800,12 +1800,10 @@ static int transaction_kthread(void *arg) ...@@ -1800,12 +1800,10 @@ static int transaction_kthread(void *arg)
if (unlikely(test_bit(BTRFS_FS_STATE_ERROR, if (unlikely(test_bit(BTRFS_FS_STATE_ERROR,
&fs_info->fs_state))) &fs_info->fs_state)))
btrfs_cleanup_transaction(fs_info); btrfs_cleanup_transaction(fs_info);
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop() && if (!kthread_should_stop() &&
(!btrfs_transaction_blocked(fs_info) || (!btrfs_transaction_blocked(fs_info) ||
cannot_commit)) cannot_commit))
schedule_timeout(delay); schedule_timeout_interruptible(delay);
__set_current_state(TASK_RUNNING);
} while (!kthread_should_stop()); } while (!kthread_should_stop());
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册