aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-11-28 00:34:39 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-02 00:36:21 -0500
commit43cf208cbe2080ff0212bd3527d915395b6129f6 (patch)
treeaae216f87029e13ac9e4565d7d0837e5b80118c5 /drivers/target
parent6cfb546bfce644bd4fb6662a5049a73406f655c9 (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.c176
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) \
590static 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) \
599static 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) \
619DEF_DEV_ATTRIB_SHOW(_name); \
620DEF_DEV_ATTRIB_STORE(_name);
621
622#define DEF_DEV_ATTRIB_RO(_name) \
623DEF_DEV_ATTRIB_SHOW(_name);
624
625CONFIGFS_EATTR_STRUCT(target_core_dev_attrib, se_dev_attrib); 589CONFIGFS_EATTR_STRUCT(target_core_dev_attrib, se_dev_attrib);
626#define SE_DEV_ATTR(_name, _mode) \
627static 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); \
634static 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
639DEF_DEV_ATTRIB(emulate_model_alias);
640SE_DEV_ATTR(emulate_model_alias, S_IRUGO | S_IWUSR);
641
642DEF_DEV_ATTRIB(emulate_dpo);
643SE_DEV_ATTR(emulate_dpo, S_IRUGO | S_IWUSR);
644
645DEF_DEV_ATTRIB(emulate_fua_write);
646SE_DEV_ATTR(emulate_fua_write, S_IRUGO | S_IWUSR);
647
648DEF_DEV_ATTRIB(emulate_fua_read);
649SE_DEV_ATTR(emulate_fua_read, S_IRUGO | S_IWUSR);
650
651DEF_DEV_ATTRIB(emulate_write_cache);
652SE_DEV_ATTR(emulate_write_cache, S_IRUGO | S_IWUSR);
653
654DEF_DEV_ATTRIB(emulate_ua_intlck_ctrl);
655SE_DEV_ATTR(emulate_ua_intlck_ctrl, S_IRUGO | S_IWUSR);
656
657DEF_DEV_ATTRIB(emulate_tas);
658SE_DEV_ATTR(emulate_tas, S_IRUGO | S_IWUSR);
659
660DEF_DEV_ATTRIB(emulate_tpu);
661SE_DEV_ATTR(emulate_tpu, S_IRUGO | S_IWUSR);
662
663DEF_DEV_ATTRIB(emulate_tpws);
664SE_DEV_ATTR(emulate_tpws, S_IRUGO | S_IWUSR);
665
666DEF_DEV_ATTRIB(emulate_caw);
667SE_DEV_ATTR(emulate_caw, S_IRUGO | S_IWUSR);
668
669DEF_DEV_ATTRIB(emulate_3pc);
670SE_DEV_ATTR(emulate_3pc, S_IRUGO | S_IWUSR);
671
672DEF_DEV_ATTRIB(pi_prot_type);
673SE_DEV_ATTR(pi_prot_type, S_IRUGO | S_IWUSR);
674
675DEF_DEV_ATTRIB_RO(hw_pi_prot_type);
676SE_DEV_ATTR_RO(hw_pi_prot_type);
677
678DEF_DEV_ATTRIB(pi_prot_format);
679SE_DEV_ATTR(pi_prot_format, S_IRUGO | S_IWUSR);
680
681DEF_DEV_ATTRIB(enforce_pr_isids);
682SE_DEV_ATTR(enforce_pr_isids, S_IRUGO | S_IWUSR);
683
684DEF_DEV_ATTRIB(is_nonrot);
685SE_DEV_ATTR(is_nonrot, S_IRUGO | S_IWUSR);
686
687DEF_DEV_ATTRIB(emulate_rest_reord);
688SE_DEV_ATTR(emulate_rest_reord, S_IRUGO | S_IWUSR);
689
690DEF_DEV_ATTRIB(force_pr_aptpl);
691SE_DEV_ATTR(force_pr_aptpl, S_IRUGO | S_IWUSR);
692
693DEF_DEV_ATTRIB_RO(hw_block_size);
694SE_DEV_ATTR_RO(hw_block_size);
695
696DEF_DEV_ATTRIB(block_size);
697SE_DEV_ATTR(block_size, S_IRUGO | S_IWUSR);
698
699DEF_DEV_ATTRIB_RO(hw_max_sectors);
700SE_DEV_ATTR_RO(hw_max_sectors);
701
702DEF_DEV_ATTRIB(fabric_max_sectors);
703SE_DEV_ATTR(fabric_max_sectors, S_IRUGO | S_IWUSR);
704
705DEF_DEV_ATTRIB(optimal_sectors);
706SE_DEV_ATTR(optimal_sectors, S_IRUGO | S_IWUSR);
707
708DEF_DEV_ATTRIB_RO(hw_queue_depth);
709SE_DEV_ATTR_RO(hw_queue_depth);
710
711DEF_DEV_ATTRIB(queue_depth);
712SE_DEV_ATTR(queue_depth, S_IRUGO | S_IWUSR);
713
714DEF_DEV_ATTRIB(max_unmap_lba_count);
715SE_DEV_ATTR(max_unmap_lba_count, S_IRUGO | S_IWUSR);
716
717DEF_DEV_ATTRIB(max_unmap_block_desc_count);
718SE_DEV_ATTR(max_unmap_block_desc_count, S_IRUGO | S_IWUSR);
719
720DEF_DEV_ATTRIB(unmap_granularity);
721SE_DEV_ATTR(unmap_granularity, S_IRUGO | S_IWUSR);
722
723DEF_DEV_ATTRIB(unmap_granularity_alignment);
724SE_DEV_ATTR(unmap_granularity_alignment, S_IRUGO | S_IWUSR);
725
726DEF_DEV_ATTRIB(max_write_same_len);
727SE_DEV_ATTR(max_write_same_len, S_IRUGO | S_IWUSR);
728
729CONFIGFS_EATTR_OPS(target_core_dev_attrib, se_dev_attrib, da_group); 590CONFIGFS_EATTR_OPS(target_core_dev_attrib, se_dev_attrib, da_group);
730 591
731static 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
765static struct configfs_item_operations target_core_dev_attrib_ops = { 592static 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
770TB_CIT_SETUP(dev_attrib, &target_core_dev_attrib_ops, NULL, 597TB_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