Commit ba1bc00f authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: use helpers to convert from seconds to jiffies in transaction_kthread

The kernel provides easy to understand helpers to convert from human
understandable units to the kernel-friendly 'jiffies'. So let's use
those to make the code easier to understand. No functional changes.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 089c8b05
......@@ -1780,7 +1780,7 @@ static int transaction_kthread(void *arg)
do {
cannot_commit = false;
delay = HZ * fs_info->commit_interval;
delay = msecs_to_jiffies(fs_info->commit_interval * 1000);
mutex_lock(&fs_info->transaction_kthread_mutex);
spin_lock(&fs_info->trans_lock);
......@@ -1795,7 +1795,7 @@ static int transaction_kthread(void *arg)
(now < cur->start_time ||
now - cur->start_time < fs_info->commit_interval)) {
spin_unlock(&fs_info->trans_lock);
delay = HZ * 5;
delay = msecs_to_jiffies(5000);
goto sleep;
}
transid = cur->transid;
......
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