@@ -529,27 +529,25 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
/* 0 isn't well defined right now, reject it */
if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_keepalive_timeout =
- msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_keepalive_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_osd_idle_ttl:
/* 0 isn't well defined right now, reject it */
if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_idle_ttl = secs_to_jiffies(result.uint_32);
break;
case Opt_mount_timeout:
/* 0 is "wait forever" (i.e. infinite timeout) */
if (result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000);
+ opt->mount_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_osd_request_timeout:
/* 0 is "wait forever" (i.e. infinite timeout) */
if (result.uint_32 > INT_MAX / 1000)
goto out_of_range;
- opt->osd_request_timeout =
- msecs_to_jiffies(result.uint_32 * 1000);
+ opt->osd_request_timeout = secs_to_jiffies(result.uint_32);
break;
case Opt_share:
@@ -4989,8 +4989,7 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc,
linger_submit(lreq);
ret = linger_reg_commit_wait(lreq);
if (!ret)
- ret = linger_notify_finish_wait(lreq,
- msecs_to_jiffies(2 * timeout * MSEC_PER_SEC));
+ ret = linger_notify_finish_wait(lreq, secs_to_jiffies(2 * timeout));
else
dout("lreq %p failed to initiate notify %d\n", lreq, ret);
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 \) ) Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com> --- net/ceph/ceph_common.c | 10 ++++------ net/ceph/osd_client.c | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-)