drivers/block/rbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can
use it to avoid scaling the time to msec.
Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
drivers/block/rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index faafd7ff43d6..92d04a60718f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4162,7 +4162,7 @@ static void rbd_acquire_lock(struct work_struct *work)
dout("%s rbd_dev %p requeuing lock_dwork\n", __func__,
rbd_dev);
mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork,
- msecs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT * MSEC_PER_SEC));
+ secs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT));
}
}
@@ -6285,7 +6285,7 @@ static int rbd_parse_param(struct fs_parameter *param,
/* 0 is "wait forever" (i.e. infinite timeout) */
if (result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->lock_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_pool_ns:
kfree(pctx->spec->pool_ns);
--
2.34.1
On 6/12/25 6:07 AM, Yuesong Li wrote:
> Since secs_to_jiffies()(commit:b35108a51cf7) has been introduced, we can
> use it to avoid scaling the time to msec.
>
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Looks good.
Reviewed-by: Alex Elder <elder@riscstar.com>
> ---
> drivers/block/rbd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index faafd7ff43d6..92d04a60718f 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -4162,7 +4162,7 @@ static void rbd_acquire_lock(struct work_struct *work)
> dout("%s rbd_dev %p requeuing lock_dwork\n", __func__,
> rbd_dev);
> mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork,
> - msecs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT * MSEC_PER_SEC));
> + secs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT));
> }
> }
>
> @@ -6285,7 +6285,7 @@ static int rbd_parse_param(struct fs_parameter *param,
> /* 0 is "wait forever" (i.e. infinite timeout) */
> if (result.uint_32 > INT_MAX / 1000)
> goto out_of_range;
> - opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000);
> + opt->lock_timeout = secs_to_jiffies(result.uint_32);
> break;
> case Opt_pool_ns:
> kfree(pctx->spec->pool_ns);
© 2016 - 2026 Red Hat, Inc.