aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-07 21:18:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-07 21:18:27 -0500
commit34a9d2c39afe74a941b9e88efe2762afc4d82443 (patch)
treeb44dbdb8de0f840f3b03ebda82a615bce199d3f7 /include
parenta694ad94bce2a0287136043e25cff856ce3a1007 (diff)
parentddca8f3ed36c5d25363dab6762829868af09cb02 (diff)
Merge branch '3.2-rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
* '3.2-rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (25 commits) iscsi-target: Fix hex2bin warn_unused compile message target: Don't return an error if disabling unsupported features target/rd: fix or rewrite the copy routine target/rd: simplify the page/offset computation target: remove the unused se_dev_list target/file: walk properly over sg list target: remove unused struct fields target: Fix page length in emulated INQUIRY VPD page 86h target: Handle 0 correctly in transport_get_sectors_6() target: Don't return an error status for 0-length READ and WRITE iscsi-target: Use kmemdup rather than duplicating its implementation iscsi-target: Add missing F_BIT for iscsi_tm_rsp iscsi-target: Fix residual count hanlding + remove iscsi_cmd->residual_count target: Reject SCSI data overflow for fabrics using transport_generic_map_mem_to_cmd target: remove the unused t_task_pt_sgl and t_task_pt_sgl_num se_cmd fields target: remove the t_tasks_bidi se_cmd field target: remove the t_tasks_fua se_cmd field target: remove the se_ordered_node se_cmd field target: remove the se_obj_ptr and se_orig_obj_ptr se_cmd fields target: Drop config_item_name usage in fabric TFO->free_wwn() ...
Diffstat (limited to 'include')
-rw-r--r--include/target/target_core_base.h46
-rw-r--r--include/target/target_core_transport.h24
2 files changed, 6 insertions, 64 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 7f5fed3c89e1..6873c7dd9145 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -103,9 +103,10 @@ enum se_cmd_flags_table {
103 SCF_SCSI_NON_DATA_CDB = 0x00000040, 103 SCF_SCSI_NON_DATA_CDB = 0x00000040,
104 SCF_SCSI_CDB_EXCEPTION = 0x00000080, 104 SCF_SCSI_CDB_EXCEPTION = 0x00000080,
105 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, 105 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100,
106 SCF_SE_CMD_FAILED = 0x00000400, 106 SCF_FUA = 0x00000200,
107 SCF_SE_LUN_CMD = 0x00000800, 107 SCF_SE_LUN_CMD = 0x00000800,
108 SCF_SE_ALLOW_EOO = 0x00001000, 108 SCF_SE_ALLOW_EOO = 0x00001000,
109 SCF_BIDI = 0x00002000,
109 SCF_SENT_CHECK_CONDITION = 0x00004000, 110 SCF_SENT_CHECK_CONDITION = 0x00004000,
110 SCF_OVERFLOW_BIT = 0x00008000, 111 SCF_OVERFLOW_BIT = 0x00008000,
111 SCF_UNDERFLOW_BIT = 0x00010000, 112 SCF_UNDERFLOW_BIT = 0x00010000,
@@ -154,6 +155,7 @@ enum tcm_sense_reason_table {
154 TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, 155 TCM_CHECK_CONDITION_ABORT_CMD = 0x0d,
155 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, 156 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e,
156 TCM_CHECK_CONDITION_NOT_READY = 0x0f, 157 TCM_CHECK_CONDITION_NOT_READY = 0x0f,
158 TCM_RESERVATION_CONFLICT = 0x10,
157}; 159};
158 160
159struct se_obj { 161struct se_obj {
@@ -211,7 +213,6 @@ struct t10_alua_lu_gp {
211 u16 lu_gp_id; 213 u16 lu_gp_id;
212 int lu_gp_valid_id; 214 int lu_gp_valid_id;
213 u32 lu_gp_members; 215 u32 lu_gp_members;
214 atomic_t lu_gp_shutdown;
215 atomic_t lu_gp_ref_cnt; 216 atomic_t lu_gp_ref_cnt;
216 spinlock_t lu_gp_lock; 217 spinlock_t lu_gp_lock;
217 struct config_group lu_gp_group; 218 struct config_group lu_gp_group;
@@ -422,11 +423,9 @@ struct se_cmd {
422 int sam_task_attr; 423 int sam_task_attr;
423 /* Transport protocol dependent state, see transport_state_table */ 424 /* Transport protocol dependent state, see transport_state_table */
424 enum transport_state_table t_state; 425 enum transport_state_table t_state;
425 /* Transport specific error status */
426 int transport_error_status;
427 /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */ 426 /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
428 int check_release:1; 427 unsigned check_release:1;
429 int cmd_wait_set:1; 428 unsigned cmd_wait_set:1;
430 /* See se_cmd_flags_table */ 429 /* See se_cmd_flags_table */
431 u32 se_cmd_flags; 430 u32 se_cmd_flags;
432 u32 se_ordered_id; 431 u32 se_ordered_id;
@@ -441,13 +440,10 @@ struct se_cmd {
441 /* Used for sense data */ 440 /* Used for sense data */
442 void *sense_buffer; 441 void *sense_buffer;
443 struct list_head se_delayed_node; 442 struct list_head se_delayed_node;
444 struct list_head se_ordered_node;
445 struct list_head se_lun_node; 443 struct list_head se_lun_node;
446 struct list_head se_qf_node; 444 struct list_head se_qf_node;
447 struct se_device *se_dev; 445 struct se_device *se_dev;
448 struct se_dev_entry *se_deve; 446 struct se_dev_entry *se_deve;
449 struct se_device *se_obj_ptr;
450 struct se_device *se_orig_obj_ptr;
451 struct se_lun *se_lun; 447 struct se_lun *se_lun;
452 /* Only used for internal passthrough and legacy TCM fabric modules */ 448 /* Only used for internal passthrough and legacy TCM fabric modules */
453 struct se_session *se_sess; 449 struct se_session *se_sess;
@@ -463,8 +459,6 @@ struct se_cmd {
463 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 459 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
464 unsigned long long t_task_lba; 460 unsigned long long t_task_lba;
465 int t_tasks_failed; 461 int t_tasks_failed;
466 int t_tasks_fua;
467 bool t_tasks_bidi;
468 u32 t_tasks_sg_chained_no; 462 u32 t_tasks_sg_chained_no;
469 atomic_t t_fe_count; 463 atomic_t t_fe_count;
470 atomic_t t_se_count; 464 atomic_t t_se_count;
@@ -489,14 +483,6 @@ struct se_cmd {
489 483
490 struct work_struct work; 484 struct work_struct work;
491 485
492 /*
493 * Used for pre-registered fabric SGL passthrough WRITE and READ
494 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
495 * and other HW target mode fabric modules.
496 */
497 struct scatterlist *t_task_pt_sgl;
498 u32 t_task_pt_sgl_num;
499
500 struct scatterlist *t_data_sg; 486 struct scatterlist *t_data_sg;
501 unsigned int t_data_nents; 487 unsigned int t_data_nents;
502 struct scatterlist *t_bidi_data_sg; 488 struct scatterlist *t_bidi_data_sg;
@@ -562,7 +548,7 @@ struct se_node_acl {
562} ____cacheline_aligned; 548} ____cacheline_aligned;
563 549
564struct se_session { 550struct se_session {
565 int sess_tearing_down:1; 551 unsigned sess_tearing_down:1;
566 u64 sess_bin_isid; 552 u64 sess_bin_isid;
567 struct se_node_acl *se_node_acl; 553 struct se_node_acl *se_node_acl;
568 struct se_portal_group *se_tpg; 554 struct se_portal_group *se_tpg;
@@ -683,7 +669,6 @@ struct se_subsystem_dev {
683 struct t10_reservation t10_pr; 669 struct t10_reservation t10_pr;
684 spinlock_t se_dev_lock; 670 spinlock_t se_dev_lock;
685 void *se_dev_su_ptr; 671 void *se_dev_su_ptr;
686 struct list_head se_dev_node;
687 struct config_group se_dev_group; 672 struct config_group se_dev_group;
688 /* For T10 Reservations */ 673 /* For T10 Reservations */
689 struct config_group se_dev_pr_group; 674 struct config_group se_dev_pr_group;
@@ -692,9 +677,6 @@ struct se_subsystem_dev {
692} ____cacheline_aligned; 677} ____cacheline_aligned;
693 678
694struct se_device { 679struct se_device {
695 /* Set to 1 if thread is NOT sleeping on thread_sem */
696 u8 thread_active;
697 u8 dev_status_timer_flags;
698 /* RELATIVE TARGET PORT IDENTIFER Counter */ 680 /* RELATIVE TARGET PORT IDENTIFER Counter */
699 u16 dev_rpti_counter; 681 u16 dev_rpti_counter;
700 /* Used for SAM Task Attribute ordering */ 682 /* Used for SAM Task Attribute ordering */
@@ -719,14 +701,10 @@ struct se_device {
719 u64 write_bytes; 701 u64 write_bytes;
720 spinlock_t stats_lock; 702 spinlock_t stats_lock;
721 /* Active commands on this virtual SE device */ 703 /* Active commands on this virtual SE device */
722 atomic_t active_cmds;
723 atomic_t simple_cmds; 704 atomic_t simple_cmds;
724 atomic_t depth_left; 705 atomic_t depth_left;
725 atomic_t dev_ordered_id; 706 atomic_t dev_ordered_id;
726 atomic_t dev_tur_active;
727 atomic_t execute_tasks; 707 atomic_t execute_tasks;
728 atomic_t dev_status_thr_count;
729 atomic_t dev_hoq_count;
730 atomic_t dev_ordered_sync; 708 atomic_t dev_ordered_sync;
731 atomic_t dev_qf_count; 709 atomic_t dev_qf_count;
732 struct se_obj dev_obj; 710 struct se_obj dev_obj;
@@ -734,14 +712,9 @@ struct se_device {
734 struct se_obj dev_export_obj; 712 struct se_obj dev_export_obj;
735 struct se_queue_obj dev_queue_obj; 713 struct se_queue_obj dev_queue_obj;
736 spinlock_t delayed_cmd_lock; 714 spinlock_t delayed_cmd_lock;
737 spinlock_t ordered_cmd_lock;
738 spinlock_t execute_task_lock; 715 spinlock_t execute_task_lock;
739 spinlock_t state_task_lock;
740 spinlock_t dev_alua_lock;
741 spinlock_t dev_reservation_lock; 716 spinlock_t dev_reservation_lock;
742 spinlock_t dev_state_lock;
743 spinlock_t dev_status_lock; 717 spinlock_t dev_status_lock;
744 spinlock_t dev_status_thr_lock;
745 spinlock_t se_port_lock; 718 spinlock_t se_port_lock;
746 spinlock_t se_tmr_lock; 719 spinlock_t se_tmr_lock;
747 spinlock_t qf_cmd_lock; 720 spinlock_t qf_cmd_lock;
@@ -753,14 +726,10 @@ struct se_device {
753 struct t10_pr_registration *dev_pr_res_holder; 726 struct t10_pr_registration *dev_pr_res_holder;
754 struct list_head dev_sep_list; 727 struct list_head dev_sep_list;
755 struct list_head dev_tmr_list; 728 struct list_head dev_tmr_list;
756 struct timer_list dev_status_timer;
757 /* Pointer to descriptor for processing thread */ 729 /* Pointer to descriptor for processing thread */
758 struct task_struct *process_thread; 730 struct task_struct *process_thread;
759 pid_t process_thread_pid;
760 struct task_struct *dev_mgmt_thread;
761 struct work_struct qf_work_queue; 731 struct work_struct qf_work_queue;
762 struct list_head delayed_cmd_list; 732 struct list_head delayed_cmd_list;
763 struct list_head ordered_cmd_list;
764 struct list_head execute_task_list; 733 struct list_head execute_task_list;
765 struct list_head state_task_list; 734 struct list_head state_task_list;
766 struct list_head qf_cmd_list; 735 struct list_head qf_cmd_list;
@@ -771,8 +740,6 @@ struct se_device {
771 struct se_subsystem_api *transport; 740 struct se_subsystem_api *transport;
772 /* Linked list for struct se_hba struct se_device list */ 741 /* Linked list for struct se_hba struct se_device list */
773 struct list_head dev_list; 742 struct list_head dev_list;
774 /* Linked list for struct se_global->g_se_dev_list */
775 struct list_head g_se_dev_list;
776} ____cacheline_aligned; 743} ____cacheline_aligned;
777 744
778struct se_hba { 745struct se_hba {
@@ -834,7 +801,6 @@ struct se_port {
834 u32 sep_index; 801 u32 sep_index;
835 struct scsi_port_stats sep_stats; 802 struct scsi_port_stats sep_stats;
836 /* Used for ALUA Target Port Groups membership */ 803 /* Used for ALUA Target Port Groups membership */
837 atomic_t sep_tg_pt_gp_active;
838 atomic_t sep_tg_pt_secondary_offline; 804 atomic_t sep_tg_pt_secondary_offline;
839 /* Used for PR ALL_TG_PT=1 */ 805 /* Used for PR ALL_TG_PT=1 */
840 atomic_t sep_tg_pt_ref_cnt; 806 atomic_t sep_tg_pt_ref_cnt;
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index c16e9431dd01..dac4f2d859fd 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -10,29 +10,6 @@
10 10
11#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */ 11#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */
12 12
13#define PYX_TRANSPORT_SENT_TO_TRANSPORT 0
14#define PYX_TRANSPORT_WRITE_PENDING 1
15
16#define PYX_TRANSPORT_UNKNOWN_SAM_OPCODE -1
17#define PYX_TRANSPORT_HBA_QUEUE_FULL -2
18#define PYX_TRANSPORT_REQ_TOO_MANY_SECTORS -3
19#define PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES -4
20#define PYX_TRANSPORT_INVALID_CDB_FIELD -5
21#define PYX_TRANSPORT_INVALID_PARAMETER_LIST -6
22#define PYX_TRANSPORT_LU_COMM_FAILURE -7
23#define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8
24#define PYX_TRANSPORT_WRITE_PROTECTED -9
25#define PYX_TRANSPORT_RESERVATION_CONFLICT -10
26#define PYX_TRANSPORT_ILLEGAL_REQUEST -11
27#define PYX_TRANSPORT_USE_SENSE_REASON -12
28
29#ifndef SAM_STAT_RESERVATION_CONFLICT
30#define SAM_STAT_RESERVATION_CONFLICT 0x18
31#endif
32
33#define TRANSPORT_PLUGIN_FREE 0
34#define TRANSPORT_PLUGIN_REGISTERED 1
35
36#define TRANSPORT_PLUGIN_PHBA_PDEV 1 13#define TRANSPORT_PLUGIN_PHBA_PDEV 1
37#define TRANSPORT_PLUGIN_VHBA_PDEV 2 14#define TRANSPORT_PLUGIN_VHBA_PDEV 2
38#define TRANSPORT_PLUGIN_VHBA_VDEV 3 15#define TRANSPORT_PLUGIN_VHBA_VDEV 3
@@ -158,7 +135,6 @@ extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
158extern int transport_handle_cdb_direct(struct se_cmd *); 135extern int transport_handle_cdb_direct(struct se_cmd *);
159extern int transport_generic_handle_cdb_map(struct se_cmd *); 136extern int transport_generic_handle_cdb_map(struct se_cmd *);
160extern int transport_generic_handle_data(struct se_cmd *); 137extern int transport_generic_handle_data(struct se_cmd *);
161extern void transport_new_cmd_failure(struct se_cmd *);
162extern int transport_generic_handle_tmr(struct se_cmd *); 138extern int transport_generic_handle_tmr(struct se_cmd *);
163extern bool target_stop_task(struct se_task *task, unsigned long *flags); 139extern bool target_stop_task(struct se_task *task, unsigned long *flags);
164extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 140extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,