diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-13 17:51:39 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-01-13 17:51:39 -0500 |
commit | 95ed644fd12f53c6fc778f3f246974e5fe3a9468 (patch) | |
tree | edf9f57192ad95f9165b3be5dbf1e8e745249ed1 /drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |
parent | 9eacee2ac624bfa9740d49355dbe6ee88d0cba0a (diff) |
IB: convert from semaphores to mutexes
semaphore to mutex conversion by Ingo and Arjan's script.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
[ Sanity-checked on real IB hardware ]
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_multicast.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 7403bac1977b..98039da0caf0 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -55,7 +55,7 @@ MODULE_PARM_DESC(mcast_debug_level, | |||
55 | "Enable multicast debug tracing if > 0"); | 55 | "Enable multicast debug tracing if > 0"); |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | static DECLARE_MUTEX(mcast_mutex); | 58 | static DEFINE_MUTEX(mcast_mutex); |
59 | 59 | ||
60 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ | 60 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ |
61 | struct ipoib_mcast { | 61 | struct ipoib_mcast { |
@@ -385,10 +385,10 @@ static void ipoib_mcast_join_complete(int status, | |||
385 | 385 | ||
386 | if (!status && !ipoib_mcast_join_finish(mcast, mcmember)) { | 386 | if (!status && !ipoib_mcast_join_finish(mcast, mcmember)) { |
387 | mcast->backoff = 1; | 387 | mcast->backoff = 1; |
388 | down(&mcast_mutex); | 388 | mutex_lock(&mcast_mutex); |
389 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 389 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
390 | queue_work(ipoib_workqueue, &priv->mcast_task); | 390 | queue_work(ipoib_workqueue, &priv->mcast_task); |
391 | up(&mcast_mutex); | 391 | mutex_unlock(&mcast_mutex); |
392 | complete(&mcast->done); | 392 | complete(&mcast->done); |
393 | return; | 393 | return; |
394 | } | 394 | } |
@@ -418,7 +418,7 @@ static void ipoib_mcast_join_complete(int status, | |||
418 | 418 | ||
419 | mcast->query = NULL; | 419 | mcast->query = NULL; |
420 | 420 | ||
421 | down(&mcast_mutex); | 421 | mutex_lock(&mcast_mutex); |
422 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) { | 422 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) { |
423 | if (status == -ETIMEDOUT) | 423 | if (status == -ETIMEDOUT) |
424 | queue_work(ipoib_workqueue, &priv->mcast_task); | 424 | queue_work(ipoib_workqueue, &priv->mcast_task); |
@@ -427,7 +427,7 @@ static void ipoib_mcast_join_complete(int status, | |||
427 | mcast->backoff * HZ); | 427 | mcast->backoff * HZ); |
428 | } else | 428 | } else |
429 | complete(&mcast->done); | 429 | complete(&mcast->done); |
430 | up(&mcast_mutex); | 430 | mutex_unlock(&mcast_mutex); |
431 | 431 | ||
432 | return; | 432 | return; |
433 | } | 433 | } |
@@ -482,12 +482,12 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast, | |||
482 | if (mcast->backoff > IPOIB_MAX_BACKOFF_SECONDS) | 482 | if (mcast->backoff > IPOIB_MAX_BACKOFF_SECONDS) |
483 | mcast->backoff = IPOIB_MAX_BACKOFF_SECONDS; | 483 | mcast->backoff = IPOIB_MAX_BACKOFF_SECONDS; |
484 | 484 | ||
485 | down(&mcast_mutex); | 485 | mutex_lock(&mcast_mutex); |
486 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 486 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
487 | queue_delayed_work(ipoib_workqueue, | 487 | queue_delayed_work(ipoib_workqueue, |
488 | &priv->mcast_task, | 488 | &priv->mcast_task, |
489 | mcast->backoff * HZ); | 489 | mcast->backoff * HZ); |
490 | up(&mcast_mutex); | 490 | mutex_unlock(&mcast_mutex); |
491 | } else | 491 | } else |
492 | mcast->query_id = ret; | 492 | mcast->query_id = ret; |
493 | } | 493 | } |
@@ -520,11 +520,11 @@ void ipoib_mcast_join_task(void *dev_ptr) | |||
520 | priv->broadcast = ipoib_mcast_alloc(dev, 1); | 520 | priv->broadcast = ipoib_mcast_alloc(dev, 1); |
521 | if (!priv->broadcast) { | 521 | if (!priv->broadcast) { |
522 | ipoib_warn(priv, "failed to allocate broadcast group\n"); | 522 | ipoib_warn(priv, "failed to allocate broadcast group\n"); |
523 | down(&mcast_mutex); | 523 | mutex_lock(&mcast_mutex); |
524 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) | 524 | if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) |
525 | queue_delayed_work(ipoib_workqueue, | 525 | queue_delayed_work(ipoib_workqueue, |
526 | &priv->mcast_task, HZ); | 526 | &priv->mcast_task, HZ); |
527 | up(&mcast_mutex); | 527 | mutex_unlock(&mcast_mutex); |
528 | return; | 528 | return; |
529 | } | 529 | } |
530 | 530 | ||
@@ -580,10 +580,10 @@ int ipoib_mcast_start_thread(struct net_device *dev) | |||
580 | 580 | ||
581 | ipoib_dbg_mcast(priv, "starting multicast thread\n"); | 581 | ipoib_dbg_mcast(priv, "starting multicast thread\n"); |
582 | 582 | ||
583 | down(&mcast_mutex); | 583 | mutex_lock(&mcast_mutex); |
584 | if (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags)) | 584 | if (!test_and_set_bit(IPOIB_MCAST_RUN, &priv->flags)) |
585 | queue_work(ipoib_workqueue, &priv->mcast_task); | 585 | queue_work(ipoib_workqueue, &priv->mcast_task); |
586 | up(&mcast_mutex); | 586 | mutex_unlock(&mcast_mutex); |
587 | 587 | ||
588 | return 0; | 588 | return 0; |
589 | } | 589 | } |
@@ -595,10 +595,10 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush) | |||
595 | 595 | ||
596 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); | 596 | ipoib_dbg_mcast(priv, "stopping multicast thread\n"); |
597 | 597 | ||
598 | down(&mcast_mutex); | 598 | mutex_lock(&mcast_mutex); |
599 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); | 599 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); |
600 | cancel_delayed_work(&priv->mcast_task); | 600 | cancel_delayed_work(&priv->mcast_task); |
601 | up(&mcast_mutex); | 601 | mutex_unlock(&mcast_mutex); |
602 | 602 | ||
603 | if (flush) | 603 | if (flush) |
604 | flush_workqueue(ipoib_workqueue); | 604 | flush_workqueue(ipoib_workqueue); |