diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-11-28 00:34:39 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-12-02 00:36:21 -0500 |
commit | 43cf208cbe2080ff0212bd3527d915395b6129f6 (patch) | |
tree | aae216f87029e13ac9e4565d7d0837e5b80118c5 /drivers/target | |
parent | 6cfb546bfce644bd4fb6662a5049a73406f655c9 (diff) |
target: Drop left-over internal dev attribute code
Now that backend drivers are populating their own device attributes,
go ahead and remove left-over definitions + internal attribute list
of device attributes from target_core_configfs.c code
Also update TB_CIT_SETUP(dev_attrib,...) to signal ct_attr = NULL.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_configfs.c | 176 |
1 files changed, 1 insertions, 175 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 2903d8931625..75d89adfccc0 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -586,189 +586,15 @@ EXPORT_SYMBOL(target_fabric_configfs_deregister); | |||
586 | 586 | ||
587 | /* Start functions for struct config_item_type tb_dev_attrib_cit */ | 587 | /* Start functions for struct config_item_type tb_dev_attrib_cit */ |
588 | 588 | ||
589 | #define DEF_DEV_ATTRIB_SHOW(_name) \ | ||
590 | static ssize_t target_core_dev_show_attr_##_name( \ | ||
591 | struct se_dev_attrib *da, \ | ||
592 | char *page) \ | ||
593 | { \ | ||
594 | return snprintf(page, PAGE_SIZE, "%u\n", \ | ||
595 | (u32)da->da_dev->dev_attrib._name); \ | ||
596 | } | ||
597 | |||
598 | #define DEF_DEV_ATTRIB_STORE(_name) \ | ||
599 | static ssize_t target_core_dev_store_attr_##_name( \ | ||
600 | struct se_dev_attrib *da, \ | ||
601 | const char *page, \ | ||
602 | size_t count) \ | ||
603 | { \ | ||
604 | unsigned long val; \ | ||
605 | int ret; \ | ||
606 | \ | ||
607 | ret = kstrtoul(page, 0, &val); \ | ||
608 | if (ret < 0) { \ | ||
609 | pr_err("kstrtoul() failed with" \ | ||
610 | " ret: %d\n", ret); \ | ||
611 | return -EINVAL; \ | ||
612 | } \ | ||
613 | ret = se_dev_set_##_name(da->da_dev, (u32)val); \ | ||
614 | \ | ||
615 | return (!ret) ? count : -EINVAL; \ | ||
616 | } | ||
617 | |||
618 | #define DEF_DEV_ATTRIB(_name) \ | ||
619 | DEF_DEV_ATTRIB_SHOW(_name); \ | ||
620 | DEF_DEV_ATTRIB_STORE(_name); | ||
621 | |||
622 | #define DEF_DEV_ATTRIB_RO(_name) \ | ||
623 | DEF_DEV_ATTRIB_SHOW(_name); | ||
624 | |||
625 | CONFIGFS_EATTR_STRUCT(target_core_dev_attrib, se_dev_attrib); | 589 | CONFIGFS_EATTR_STRUCT(target_core_dev_attrib, se_dev_attrib); |
626 | #define SE_DEV_ATTR(_name, _mode) \ | ||
627 | static struct target_core_dev_attrib_attribute \ | ||
628 | target_core_dev_attrib_##_name = \ | ||
629 | __CONFIGFS_EATTR(_name, _mode, \ | ||
630 | target_core_dev_show_attr_##_name, \ | ||
631 | target_core_dev_store_attr_##_name); | ||
632 | |||
633 | #define SE_DEV_ATTR_RO(_name); \ | ||
634 | static struct target_core_dev_attrib_attribute \ | ||
635 | target_core_dev_attrib_##_name = \ | ||
636 | __CONFIGFS_EATTR_RO(_name, \ | ||
637 | target_core_dev_show_attr_##_name); | ||
638 | |||
639 | DEF_DEV_ATTRIB(emulate_model_alias); | ||
640 | SE_DEV_ATTR(emulate_model_alias, S_IRUGO | S_IWUSR); | ||
641 | |||
642 | DEF_DEV_ATTRIB(emulate_dpo); | ||
643 | SE_DEV_ATTR(emulate_dpo, S_IRUGO | S_IWUSR); | ||
644 | |||
645 | DEF_DEV_ATTRIB(emulate_fua_write); | ||
646 | SE_DEV_ATTR(emulate_fua_write, S_IRUGO | S_IWUSR); | ||
647 | |||
648 | DEF_DEV_ATTRIB(emulate_fua_read); | ||
649 | SE_DEV_ATTR(emulate_fua_read, S_IRUGO | S_IWUSR); | ||
650 | |||
651 | DEF_DEV_ATTRIB(emulate_write_cache); | ||
652 | SE_DEV_ATTR(emulate_write_cache, S_IRUGO | S_IWUSR); | ||
653 | |||
654 | DEF_DEV_ATTRIB(emulate_ua_intlck_ctrl); | ||
655 | SE_DEV_ATTR(emulate_ua_intlck_ctrl, S_IRUGO | S_IWUSR); | ||
656 | |||
657 | DEF_DEV_ATTRIB(emulate_tas); | ||
658 | SE_DEV_ATTR(emulate_tas, S_IRUGO | S_IWUSR); | ||
659 | |||
660 | DEF_DEV_ATTRIB(emulate_tpu); | ||
661 | SE_DEV_ATTR(emulate_tpu, S_IRUGO | S_IWUSR); | ||
662 | |||
663 | DEF_DEV_ATTRIB(emulate_tpws); | ||
664 | SE_DEV_ATTR(emulate_tpws, S_IRUGO | S_IWUSR); | ||
665 | |||
666 | DEF_DEV_ATTRIB(emulate_caw); | ||
667 | SE_DEV_ATTR(emulate_caw, S_IRUGO | S_IWUSR); | ||
668 | |||
669 | DEF_DEV_ATTRIB(emulate_3pc); | ||
670 | SE_DEV_ATTR(emulate_3pc, S_IRUGO | S_IWUSR); | ||
671 | |||
672 | DEF_DEV_ATTRIB(pi_prot_type); | ||
673 | SE_DEV_ATTR(pi_prot_type, S_IRUGO | S_IWUSR); | ||
674 | |||
675 | DEF_DEV_ATTRIB_RO(hw_pi_prot_type); | ||
676 | SE_DEV_ATTR_RO(hw_pi_prot_type); | ||
677 | |||
678 | DEF_DEV_ATTRIB(pi_prot_format); | ||
679 | SE_DEV_ATTR(pi_prot_format, S_IRUGO | S_IWUSR); | ||
680 | |||
681 | DEF_DEV_ATTRIB(enforce_pr_isids); | ||
682 | SE_DEV_ATTR(enforce_pr_isids, S_IRUGO | S_IWUSR); | ||
683 | |||
684 | DEF_DEV_ATTRIB(is_nonrot); | ||
685 | SE_DEV_ATTR(is_nonrot, S_IRUGO | S_IWUSR); | ||
686 | |||
687 | DEF_DEV_ATTRIB(emulate_rest_reord); | ||
688 | SE_DEV_ATTR(emulate_rest_reord, S_IRUGO | S_IWUSR); | ||
689 | |||
690 | DEF_DEV_ATTRIB(force_pr_aptpl); | ||
691 | SE_DEV_ATTR(force_pr_aptpl, S_IRUGO | S_IWUSR); | ||
692 | |||
693 | DEF_DEV_ATTRIB_RO(hw_block_size); | ||
694 | SE_DEV_ATTR_RO(hw_block_size); | ||
695 | |||
696 | DEF_DEV_ATTRIB(block_size); | ||
697 | SE_DEV_ATTR(block_size, S_IRUGO | S_IWUSR); | ||
698 | |||
699 | DEF_DEV_ATTRIB_RO(hw_max_sectors); | ||
700 | SE_DEV_ATTR_RO(hw_max_sectors); | ||
701 | |||
702 | DEF_DEV_ATTRIB(fabric_max_sectors); | ||
703 | SE_DEV_ATTR(fabric_max_sectors, S_IRUGO | S_IWUSR); | ||
704 | |||
705 | DEF_DEV_ATTRIB(optimal_sectors); | ||
706 | SE_DEV_ATTR(optimal_sectors, S_IRUGO | S_IWUSR); | ||
707 | |||
708 | DEF_DEV_ATTRIB_RO(hw_queue_depth); | ||
709 | SE_DEV_ATTR_RO(hw_queue_depth); | ||
710 | |||
711 | DEF_DEV_ATTRIB(queue_depth); | ||
712 | SE_DEV_ATTR(queue_depth, S_IRUGO | S_IWUSR); | ||
713 | |||
714 | DEF_DEV_ATTRIB(max_unmap_lba_count); | ||
715 | SE_DEV_ATTR(max_unmap_lba_count, S_IRUGO | S_IWUSR); | ||
716 | |||
717 | DEF_DEV_ATTRIB(max_unmap_block_desc_count); | ||
718 | SE_DEV_ATTR(max_unmap_block_desc_count, S_IRUGO | S_IWUSR); | ||
719 | |||
720 | DEF_DEV_ATTRIB(unmap_granularity); | ||
721 | SE_DEV_ATTR(unmap_granularity, S_IRUGO | S_IWUSR); | ||
722 | |||
723 | DEF_DEV_ATTRIB(unmap_granularity_alignment); | ||
724 | SE_DEV_ATTR(unmap_granularity_alignment, S_IRUGO | S_IWUSR); | ||
725 | |||
726 | DEF_DEV_ATTRIB(max_write_same_len); | ||
727 | SE_DEV_ATTR(max_write_same_len, S_IRUGO | S_IWUSR); | ||
728 | |||
729 | CONFIGFS_EATTR_OPS(target_core_dev_attrib, se_dev_attrib, da_group); | 590 | CONFIGFS_EATTR_OPS(target_core_dev_attrib, se_dev_attrib, da_group); |
730 | 591 | ||
731 | static struct configfs_attribute *target_core_dev_attrib_attrs[] = { | ||
732 | &target_core_dev_attrib_emulate_model_alias.attr, | ||
733 | &target_core_dev_attrib_emulate_dpo.attr, | ||
734 | &target_core_dev_attrib_emulate_fua_write.attr, | ||
735 | &target_core_dev_attrib_emulate_fua_read.attr, | ||
736 | &target_core_dev_attrib_emulate_write_cache.attr, | ||
737 | &target_core_dev_attrib_emulate_ua_intlck_ctrl.attr, | ||
738 | &target_core_dev_attrib_emulate_tas.attr, | ||
739 | &target_core_dev_attrib_emulate_tpu.attr, | ||
740 | &target_core_dev_attrib_emulate_tpws.attr, | ||
741 | &target_core_dev_attrib_emulate_caw.attr, | ||
742 | &target_core_dev_attrib_emulate_3pc.attr, | ||
743 | &target_core_dev_attrib_pi_prot_type.attr, | ||
744 | &target_core_dev_attrib_hw_pi_prot_type.attr, | ||
745 | &target_core_dev_attrib_pi_prot_format.attr, | ||
746 | &target_core_dev_attrib_enforce_pr_isids.attr, | ||
747 | &target_core_dev_attrib_force_pr_aptpl.attr, | ||
748 | &target_core_dev_attrib_is_nonrot.attr, | ||
749 | &target_core_dev_attrib_emulate_rest_reord.attr, | ||
750 | &target_core_dev_attrib_hw_block_size.attr, | ||
751 | &target_core_dev_attrib_block_size.attr, | ||
752 | &target_core_dev_attrib_hw_max_sectors.attr, | ||
753 | &target_core_dev_attrib_fabric_max_sectors.attr, | ||
754 | &target_core_dev_attrib_optimal_sectors.attr, | ||
755 | &target_core_dev_attrib_hw_queue_depth.attr, | ||
756 | &target_core_dev_attrib_queue_depth.attr, | ||
757 | &target_core_dev_attrib_max_unmap_lba_count.attr, | ||
758 | &target_core_dev_attrib_max_unmap_block_desc_count.attr, | ||
759 | &target_core_dev_attrib_unmap_granularity.attr, | ||
760 | &target_core_dev_attrib_unmap_granularity_alignment.attr, | ||
761 | &target_core_dev_attrib_max_write_same_len.attr, | ||
762 | NULL, | ||
763 | }; | ||
764 | |||
765 | static struct configfs_item_operations target_core_dev_attrib_ops = { | 592 | static struct configfs_item_operations target_core_dev_attrib_ops = { |
766 | .show_attribute = target_core_dev_attrib_attr_show, | 593 | .show_attribute = target_core_dev_attrib_attr_show, |
767 | .store_attribute = target_core_dev_attrib_attr_store, | 594 | .store_attribute = target_core_dev_attrib_attr_store, |
768 | }; | 595 | }; |
769 | 596 | ||
770 | TB_CIT_SETUP(dev_attrib, &target_core_dev_attrib_ops, NULL, | 597 | TB_CIT_SETUP(dev_attrib, &target_core_dev_attrib_ops, NULL, NULL); |
771 | target_core_dev_attrib_attrs); | ||
772 | 598 | ||
773 | /* End functions for struct config_item_type tb_dev_attrib_cit */ | 599 | /* End functions for struct config_item_type tb_dev_attrib_cit */ |
774 | 600 | ||