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>
This commit is contained in:
parent
eab9b38939
commit
727cbfea62
@ -435,9 +435,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
|
|||||||
spin_unlock(&op->lock);
|
spin_unlock(&op->lock);
|
||||||
|
|
||||||
if (!signal_pending(current)) {
|
if (!signal_pending(current)) {
|
||||||
int timeout =
|
int timeout = op_timeout_secs * HZ;
|
||||||
MSECS_TO_JIFFIES(1000 *
|
|
||||||
op_timeout_secs);
|
|
||||||
if (!schedule_timeout(timeout)) {
|
if (!schedule_timeout(timeout)) {
|
||||||
gossip_debug(GOSSIP_DEV_DEBUG,
|
gossip_debug(GOSSIP_DEV_DEBUG,
|
||||||
"%s: timed out.\n",
|
"%s: timed out.\n",
|
||||||
|
@ -377,13 +377,11 @@ static int wait_for_a_slot(struct slot_args *slargs, int *buffer_index)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (!signal_pending(current)) {
|
if (!signal_pending(current)) {
|
||||||
int timeout =
|
|
||||||
MSECS_TO_JIFFIES(1000 * slot_timeout_secs);
|
|
||||||
gossip_debug(GOSSIP_BUFMAP_DEBUG,
|
gossip_debug(GOSSIP_BUFMAP_DEBUG,
|
||||||
"[BUFMAP]: waiting %d "
|
"[BUFMAP]: waiting %d "
|
||||||
"seconds for a slot\n",
|
"seconds for a slot\n",
|
||||||
slot_timeout_secs);
|
slot_timeout_secs);
|
||||||
if (!schedule_timeout(timeout)) {
|
if (!schedule_timeout(slot_timeout_secs * HZ)) {
|
||||||
gossip_debug(GOSSIP_BUFMAP_DEBUG,
|
gossip_debug(GOSSIP_BUFMAP_DEBUG,
|
||||||
"*** wait_for_a_slot timed out\n");
|
"*** wait_for_a_slot timed out\n");
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
|
@ -80,11 +80,6 @@ sizeof(__u64) + sizeof(struct orangefs_upcall_s))
|
|||||||
#define MAX_DEV_REQ_DOWNSIZE (2 * sizeof(__s32) + \
|
#define MAX_DEV_REQ_DOWNSIZE (2 * sizeof(__s32) + \
|
||||||
sizeof(__u64) + sizeof(struct orangefs_downcall_s))
|
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
|
* valid orangefs kernel operation states
|
||||||
*
|
*
|
||||||
|
@ -235,8 +235,8 @@ int service_operation(struct orangefs_kernel_op_s *op,
|
|||||||
* Wait for orangefs_bufmap_initialize() to wake me up
|
* Wait for orangefs_bufmap_initialize() to wake me up
|
||||||
* within the allotted time.
|
* within the allotted time.
|
||||||
*/
|
*/
|
||||||
ret = schedule_timeout(MSECS_TO_JIFFIES
|
ret = schedule_timeout(
|
||||||
(1000 * ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS));
|
ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS * HZ);
|
||||||
|
|
||||||
gossip_debug(GOSSIP_WAIT_DEBUG,
|
gossip_debug(GOSSIP_WAIT_DEBUG,
|
||||||
"Value returned from schedule_timeout:"
|
"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
|
* subsequent attempts, we retry exactly once
|
||||||
* with timeouts
|
* with timeouts
|
||||||
*/
|
*/
|
||||||
if (!schedule_timeout(MSECS_TO_JIFFIES
|
if (!schedule_timeout(op_timeout_secs * HZ)) {
|
||||||
(1000 * op_timeout_secs))) {
|
|
||||||
gossip_debug(GOSSIP_WAIT_DEBUG,
|
gossip_debug(GOSSIP_WAIT_DEBUG,
|
||||||
"*** %s:"
|
"*** %s:"
|
||||||
" operation timed out (tag"
|
" 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",
|
"%s:About to call schedule_timeout.\n",
|
||||||
__func__);
|
__func__);
|
||||||
spin_unlock(&op->lock);
|
spin_unlock(&op->lock);
|
||||||
ret =
|
ret = schedule_timeout(op_timeout_secs * HZ);
|
||||||
schedule_timeout(MSECS_TO_JIFFIES(1000 * op_timeout_secs));
|
|
||||||
|
|
||||||
gossip_debug(GOSSIP_WAIT_DEBUG,
|
gossip_debug(GOSSIP_WAIT_DEBUG,
|
||||||
"%s:Value returned from schedule_timeout(%d).\n",
|
"%s:Value returned from schedule_timeout(%d).\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user