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: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2020-10-08 15:24:27 +03:00 committed by David Sterba
parent 089c8b0551
commit ba1bc00f35

View File

@ -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;