summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-23 13:17:55 -0500
committerMike Marshall <hubcap@omnibond.com>2016-01-23 15:20:11 -0500
commit727cbfea623b78d46ce8e0f8c931b5189f3fe2e0 (patch)
tree43876fa45e56611fd9901f1b943be7438adbc518
parenteab9b38939fae1b7731570478718a5d1b2f28ea9 (diff)
orangefs: get rid of MSECS_TO_JIFFIES
All timeouts are in _seconds_, so all calls are of form MSECS_TO_JIFFIES(n * 1000), which is a convoluted way to spell n * HZ. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
-rw-r--r--fs/orangefs/devorangefs-req.c4
-rw-r--r--fs/orangefs/orangefs-bufmap.c4
-rw-r--r--fs/orangefs/orangefs-kernel.h5
-rw-r--r--fs/orangefs/waitqueue.c10
4 files changed, 6 insertions, 17 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index b7a6aa44ce3e..d8c436a0aa1b 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -435,9 +435,7 @@ wakeup:
spin_unlock(&op->lock);
if (!signal_pending(current)) {
- int timeout =
- MSECS_TO_JIFFIES(1000 *
- op_timeout_secs);
+ int timeout = op_timeout_secs * HZ;
if (!schedule_timeout(timeout)) {
gossip_debug(GOSSIP_DEV_DEBUG,
"%s: timed out.\n",
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 15baecb8094d..c60019de1fd8 100644
--- a/fs/orangefs/orangefs-bufmap.c
+++ b/fs/orangefs/orangefs-bufmap.c
@@ -377,13 +377,11 @@ static int wait_for_a_slot(struct slot_args *slargs, int *buffer_index)
break;
if (!signal_pending(current)) {
- int timeout =
- MSECS_TO_JIFFIES(1000 * slot_timeout_secs);
gossip_debug(GOSSIP_BUFMAP_DEBUG,
"[BUFMAP]: waiting %d "
"seconds for a slot\n",
slot_timeout_secs);
- if (!schedule_timeout(timeout)) {
+ if (!schedule_timeout(slot_timeout_secs * HZ)) {
gossip_debug(GOSSIP_BUFMAP_DEBUG,
"*** wait_for_a_slot timed out\n");
ret = -ETIMEDOUT;
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h
index f96ec3da6b00..2b72806d0f68 100644
--- a/fs/orangefs/orangefs-kernel.h
+++ b/fs/orangefs/orangefs-kernel.h
@@ -80,11 +80,6 @@ sizeof(__u64) + sizeof(struct orangefs_upcall_s))
#define MAX_DEV_REQ_DOWNSIZE (2 * sizeof(__s32) + \
sizeof(__u64) + sizeof(struct orangefs_downcall_s))
-/* borrowed from irda.h */
-#ifndef MSECS_TO_JIFFIES
-#define MSECS_TO_JIFFIES(ms) (((ms)*HZ+999)/1000)
-#endif
-
/*
* valid orangefs kernel operation states
*
diff --git a/fs/orangefs/waitqueue.c b/fs/orangefs/waitqueue.c
index 699ffd8b2a51..cdbf57bef3eb 100644
--- a/fs/orangefs/waitqueue.c
+++ b/fs/orangefs/waitqueue.c
@@ -235,8 +235,8 @@ retry_servicing:
* Wait for orangefs_bufmap_initialize() to wake me up
* within the allotted time.
*/
- ret = schedule_timeout(MSECS_TO_JIFFIES
- (1000 * ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS));
+ ret = schedule_timeout(
+ ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS * HZ);
gossip_debug(GOSSIP_WAIT_DEBUG,
"Value returned from schedule_timeout:"
@@ -375,8 +375,7 @@ static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op)
* subsequent attempts, we retry exactly once
* with timeouts
*/
- if (!schedule_timeout(MSECS_TO_JIFFIES
- (1000 * op_timeout_secs))) {
+ if (!schedule_timeout(op_timeout_secs * HZ)) {
gossip_debug(GOSSIP_WAIT_DEBUG,
"*** %s:"
" operation timed out (tag"
@@ -469,8 +468,7 @@ static int wait_for_cancellation_downcall(struct orangefs_kernel_op_s *op)
"%s:About to call schedule_timeout.\n",
__func__);
spin_unlock(&op->lock);
- ret =
- schedule_timeout(MSECS_TO_JIFFIES(1000 * op_timeout_secs));
+ ret = schedule_timeout(op_timeout_secs * HZ);
gossip_debug(GOSSIP_WAIT_DEBUG,
"%s:Value returned from schedule_timeout(%d).\n",