From 8ef9019ed2acdf74dce7c8b5618bf2bdabb47004 Mon Sep 17 00:00:00 2001 From: Easwar Hariharan Date: Tue, 25 Feb 2025 20:17:19 +0000 Subject: btrfs: convert timeouts to secs_to_jiffies() Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies() to avoid the multiplication This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Link: https://lkml.kernel.org/r/20250225-converge-secs-to-jiffies-part-two-v3-5-a43967e36c88@linux.microsoft.com Signed-off-by: Easwar Hariharan Acked-by: David Sterba Cc: Carlos Maiolino Cc: Carlos Maiolino Cc: Chris Mason Cc: Christoph Hellwig Cc: Damien Le Maol Cc: "Darrick J. Wong" Cc: Dick Kennedy Cc: Dongsheng Yang Cc: Fabio Estevam Cc: Frank Li Cc: Hans de Goede Cc: Henrique de Moraes Holschuh Cc: Ilpo Jarvinen Cc: Ilya Dryomov Cc: James Bottomley Cc: James Smart Cc: Jaroslav Kysela Cc: Jason Gunthorpe Cc: Jens Axboe Cc: Josef Bacik Cc: Julia Lawall Cc: Kalesh Anakkur Purayil Cc: Keith Busch Cc: Leon Romanovsky Cc: Marc Kleine-Budde Cc: Mark Brown Cc: "Martin K. Petersen" Cc: Nicolas Palix Cc: Niklas Cassel Cc: Oded Gabbay Cc: Sagi Grimberg Cc: Sascha Hauer Cc: Sebastian Reichel Cc: Selvin Thyparampil Xavier Cc: Shawn Guo Cc: Shyam-sundar S-k Cc: Takashi Iwai Cc: Takashi Iwai Cc: Xiubo Li Signed-off-by: Andrew Morton --- fs/btrfs/disk-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/btrfs/disk-io.c') diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f09db62e61a1..ed2772d27919 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1568,7 +1568,7 @@ static int transaction_kthread(void *arg) do { cannot_commit = false; - delay = msecs_to_jiffies(fs_info->commit_interval * 1000); + delay = secs_to_jiffies(fs_info->commit_interval); mutex_lock(&fs_info->transaction_kthread_mutex); spin_lock(&fs_info->trans_lock); @@ -1583,9 +1583,9 @@ static int transaction_kthread(void *arg) cur->state < TRANS_STATE_COMMIT_PREP && delta < fs_info->commit_interval) { spin_unlock(&fs_info->trans_lock); - delay -= msecs_to_jiffies((delta - 1) * 1000); + delay -= secs_to_jiffies(delta - 1); delay = min(delay, - msecs_to_jiffies(fs_info->commit_interval * 1000)); + secs_to_jiffies(fs_info->commit_interval)); goto sleep; } transid = cur->transid; -- cgit