aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2011-04-01 19:05:53 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:18:59 -0400
commitb3960afe0477781c84faa2e92dfb00016d6d4e30 (patch)
treeb83b296f74c097e1ec005681e807f8de68416c80
parent5c2dce26fd670607b5ff04f18efa38739805f6d6 (diff)
[SCSI] libfcoe: Remove mutex_trylock/restart_syscall checks
This code was incorrectly ported from fcoe.c when the fcoe transport infrastructure was put into place. It was originally needed in fcoe.c when dealing with the rtnl mutex. In that code it was only needed to avoid a lockdep false positive. In libfcoe we don't deal with the rtnl mutex, we don't get the lockdep false positive and therefore we don't need these checks. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/fcoe/fcoe_transport.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index 258684101bfd..7b61d00f5c43 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -530,9 +530,6 @@ static int fcoe_transport_create(const char *buffer, struct kernel_param *kp)
530 struct fcoe_transport *ft = NULL; 530 struct fcoe_transport *ft = NULL;
531 enum fip_state fip_mode = (enum fip_state)(long)kp->arg; 531 enum fip_state fip_mode = (enum fip_state)(long)kp->arg;
532 532
533 if (!mutex_trylock(&ft_mutex))
534 return restart_syscall();
535
536#ifdef CONFIG_LIBFCOE_MODULE 533#ifdef CONFIG_LIBFCOE_MODULE
537 /* 534 /*
538 * Make sure the module has been initialized, and is not about to be 535 * Make sure the module has been initialized, and is not about to be
@@ -543,6 +540,8 @@ static int fcoe_transport_create(const char *buffer, struct kernel_param *kp)
543 goto out_nodev; 540 goto out_nodev;
544#endif 541#endif
545 542
543 mutex_lock(&ft_mutex);
544
546 netdev = fcoe_if_to_netdev(buffer); 545 netdev = fcoe_if_to_netdev(buffer);
547 if (!netdev) { 546 if (!netdev) {
548 LIBFCOE_TRANSPORT_DBG("Invalid device %s.\n", buffer); 547 LIBFCOE_TRANSPORT_DBG("Invalid device %s.\n", buffer);
@@ -586,10 +585,7 @@ out_putdev:
586 dev_put(netdev); 585 dev_put(netdev);
587out_nodev: 586out_nodev:
588 mutex_unlock(&ft_mutex); 587 mutex_unlock(&ft_mutex);
589 if (rc == -ERESTARTSYS) 588 return rc;
590 return restart_syscall();
591 else
592 return rc;
593} 589}
594 590
595/** 591/**
@@ -608,9 +604,6 @@ static int fcoe_transport_destroy(const char *buffer, struct kernel_param *kp)
608 struct net_device *netdev = NULL; 604 struct net_device *netdev = NULL;
609 struct fcoe_transport *ft = NULL; 605 struct fcoe_transport *ft = NULL;
610 606
611 if (!mutex_trylock(&ft_mutex))
612 return restart_syscall();
613
614#ifdef CONFIG_LIBFCOE_MODULE 607#ifdef CONFIG_LIBFCOE_MODULE
615 /* 608 /*
616 * Make sure the module has been initialized, and is not about to be 609 * Make sure the module has been initialized, and is not about to be
@@ -621,6 +614,8 @@ static int fcoe_transport_destroy(const char *buffer, struct kernel_param *kp)
621 goto out_nodev; 614 goto out_nodev;
622#endif 615#endif
623 616
617 mutex_lock(&ft_mutex);
618
624 netdev = fcoe_if_to_netdev(buffer); 619 netdev = fcoe_if_to_netdev(buffer);
625 if (!netdev) { 620 if (!netdev) {
626 LIBFCOE_TRANSPORT_DBG("invalid device %s.\n", buffer); 621 LIBFCOE_TRANSPORT_DBG("invalid device %s.\n", buffer);
@@ -645,11 +640,7 @@ out_putdev:
645 dev_put(netdev); 640 dev_put(netdev);
646out_nodev: 641out_nodev:
647 mutex_unlock(&ft_mutex); 642 mutex_unlock(&ft_mutex);
648 643 return rc;
649 if (rc == -ERESTARTSYS)
650 return restart_syscall();
651 else
652 return rc;
653} 644}
654 645
655/** 646/**
@@ -667,9 +658,6 @@ static int fcoe_transport_disable(const char *buffer, struct kernel_param *kp)
667 struct net_device *netdev = NULL; 658 struct net_device *netdev = NULL;
668 struct fcoe_transport *ft = NULL; 659 struct fcoe_transport *ft = NULL;
669 660
670 if (!mutex_trylock(&ft_mutex))
671 return restart_syscall();
672
673#ifdef CONFIG_LIBFCOE_MODULE 661#ifdef CONFIG_LIBFCOE_MODULE
674 /* 662 /*
675 * Make sure the module has been initialized, and is not about to be 663 * Make sure the module has been initialized, and is not about to be
@@ -680,6 +668,8 @@ static int fcoe_transport_disable(const char *buffer, struct kernel_param *kp)
680 goto out_nodev; 668 goto out_nodev;
681#endif 669#endif
682 670
671 mutex_lock(&ft_mutex);
672
683 netdev = fcoe_if_to_netdev(buffer); 673 netdev = fcoe_if_to_netdev(buffer);
684 if (!netdev) 674 if (!netdev)
685 goto out_nodev; 675 goto out_nodev;
@@ -716,9 +706,6 @@ static int fcoe_transport_enable(const char *buffer, struct kernel_param *kp)
716 struct net_device *netdev = NULL; 706 struct net_device *netdev = NULL;
717 struct fcoe_transport *ft = NULL; 707 struct fcoe_transport *ft = NULL;
718 708
719 if (!mutex_trylock(&ft_mutex))
720 return restart_syscall();
721
722#ifdef CONFIG_LIBFCOE_MODULE 709#ifdef CONFIG_LIBFCOE_MODULE
723 /* 710 /*
724 * Make sure the module has been initialized, and is not about to be 711 * Make sure the module has been initialized, and is not about to be
@@ -729,6 +716,8 @@ static int fcoe_transport_enable(const char *buffer, struct kernel_param *kp)
729 goto out_nodev; 716 goto out_nodev;
730#endif 717#endif
731 718
719 mutex_lock(&ft_mutex);
720
732 netdev = fcoe_if_to_netdev(buffer); 721 netdev = fcoe_if_to_netdev(buffer);
733 if (!netdev) 722 if (!netdev)
734 goto out_nodev; 723 goto out_nodev;
@@ -743,10 +732,7 @@ out_putdev:
743 dev_put(netdev); 732 dev_put(netdev);
744out_nodev: 733out_nodev:
745 mutex_unlock(&ft_mutex); 734 mutex_unlock(&ft_mutex);
746 if (rc == -ERESTARTSYS) 735 return rc;
747 return restart_syscall();
748 else
749 return rc;
750} 736}
751 737
752/** 738/**