Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

target: header reshuffle, part2

This reorganized the headers under include/target into:

- target_core_base.h stays as is with all target-wide data stuctures and defines
- target_core_backend.h contains the whole interface to I/O backends
- target_core_fabric.h contains the whole interface to fabric modules

Except for those only the various configfs macro headers stay around.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

authored by

Christoph Hellwig and committed by
Nicholas Bellinger
c4795fb2 e26d99ae

+288 -462
+3 -12
Documentation/target/tcm_mod_builder.py
··· 230 230 buf += "#include <linux/ctype.h>\n" 231 231 buf += "#include <asm/unaligned.h>\n\n" 232 232 buf += "#include <target/target_core_base.h>\n" 233 - buf += "#include <target/target_core_transport.h>\n" 234 - buf += "#include <target/target_core_fabric_ops.h>\n" 233 + buf += "#include <target/target_core_fabric.h>\n" 235 234 buf += "#include <target/target_core_fabric_configfs.h>\n" 236 - buf += "#include <target/target_core_fabric_lib.h>\n" 237 - buf += "#include <target/target_core_device.h>\n" 238 - buf += "#include <target/target_core_tpg.h>\n" 239 235 buf += "#include <target/target_core_configfs.h>\n" 240 - buf += "#include <target/target_core_base.h>\n" 241 236 buf += "#include <target/configfs_macros.h>\n\n" 242 237 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 243 238 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" ··· 509 514 510 515 def tcm_mod_scan_fabric_ops(tcm_dir): 511 516 512 - fabric_ops_api = tcm_dir + "include/target/target_core_fabric_ops.h" 517 + fabric_ops_api = tcm_dir + "include/target/target_core_fabric.h" 513 518 514 519 print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api 515 520 process_fo = 0; ··· 574 579 buf += "#include <scsi/scsi_cmnd.h>\n" 575 580 buf += "#include <scsi/libfc.h>\n\n" 576 581 buf += "#include <target/target_core_base.h>\n" 577 - buf += "#include <target/target_core_transport.h>\n" 578 - buf += "#include <target/target_core_fabric_ops.h>\n" 579 - buf += "#include <target/target_core_fabric_lib.h>\n" 580 - buf += "#include <target/target_core_device.h>\n" 581 - buf += "#include <target/target_core_tpg.h>\n" 582 + buf += "#include <target/target_core_fabric.h>\n" 582 583 buf += "#include <target/target_core_configfs.h>\n\n" 583 584 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 584 585 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
+1 -2
drivers/target/iscsi/iscsi_target.c
··· 27 27 #include <scsi/scsi_device.h> 28 28 #include <scsi/iscsi_proto.h> 29 29 #include <target/target_core_base.h> 30 - #include <target/target_core_tmr.h> 31 - #include <target/target_core_transport.h> 30 + #include <target/target_core_fabric.h> 32 31 33 32 #include "iscsi_target_core.h" 34 33 #include "iscsi_target_parameters.h"
+1 -5
drivers/target/iscsi/iscsi_target_configfs.c
··· 22 22 #include <linux/configfs.h> 23 23 #include <linux/export.h> 24 24 #include <target/target_core_base.h> 25 - #include <target/target_core_transport.h> 26 - #include <target/target_core_fabric_ops.h> 25 + #include <target/target_core_fabric.h> 27 26 #include <target/target_core_fabric_configfs.h> 28 - #include <target/target_core_fabric_lib.h> 29 - #include <target/target_core_device.h> 30 - #include <target/target_core_tpg.h> 31 27 #include <target/target_core_configfs.h> 32 28 #include <target/configfs_macros.h> 33 29
+1 -2
drivers/target/iscsi/iscsi_target_device.c
··· 21 21 22 22 #include <scsi/scsi_device.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_device.h> 25 - #include <target/target_core_transport.h> 24 + #include <target/target_core_fabric.h> 26 25 27 26 #include "iscsi_target_core.h" 28 27 #include "iscsi_target_device.h"
+1 -1
drivers/target/iscsi/iscsi_target_erl0.c
··· 21 21 22 22 #include <scsi/iscsi_proto.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_transport.h> 24 + #include <target/target_core_fabric.h> 25 25 26 26 #include "iscsi_target_core.h" 27 27 #include "iscsi_target_seq_pdu_list.h"
+1 -1
drivers/target/iscsi/iscsi_target_erl1.c
··· 21 21 #include <linux/list.h> 22 22 #include <scsi/iscsi_proto.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_transport.h> 24 + #include <target/target_core_fabric.h> 25 25 26 26 #include "iscsi_target_core.h" 27 27 #include "iscsi_target_seq_pdu_list.h"
+1 -1
drivers/target/iscsi/iscsi_target_erl2.c
··· 21 21 22 22 #include <scsi/iscsi_proto.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_transport.h> 24 + #include <target/target_core_fabric.h> 25 25 26 26 #include "iscsi_target_core.h" 27 27 #include "iscsi_target_datain_values.h"
+1 -1
drivers/target/iscsi/iscsi_target_login.c
··· 23 23 #include <linux/crypto.h> 24 24 #include <scsi/iscsi_proto.h> 25 25 #include <target/target_core_base.h> 26 - #include <target/target_core_transport.h> 26 + #include <target/target_core_fabric.h> 27 27 28 28 #include "iscsi_target_core.h" 29 29 #include "iscsi_target_tq.h"
+1 -1
drivers/target/iscsi/iscsi_target_nego.c
··· 21 21 #include <linux/ctype.h> 22 22 #include <scsi/iscsi_proto.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_tpg.h> 24 + #include <target/target_core_fabric.h> 25 25 26 26 #include "iscsi_target_core.h" 27 27 #include "iscsi_target_parameters.h"
-1
drivers/target/iscsi/iscsi_target_nodeattrib.c
··· 19 19 ******************************************************************************/ 20 20 21 21 #include <target/target_core_base.h> 22 - #include <target/target_core_transport.h> 23 22 24 23 #include "iscsi_target_core.h" 25 24 #include "iscsi_target_device.h"
-1
drivers/target/iscsi/iscsi_target_stat.c
··· 23 23 #include <linux/export.h> 24 24 #include <scsi/iscsi_proto.h> 25 25 #include <target/target_core_base.h> 26 - #include <target/target_core_transport.h> 27 26 #include <target/configfs_macros.h> 28 27 29 28 #include "iscsi_target_core.h"
+1 -1
drivers/target/iscsi/iscsi_target_tmr.c
··· 21 21 #include <asm/unaligned.h> 22 22 #include <scsi/iscsi_proto.h> 23 23 #include <target/target_core_base.h> 24 - #include <target/target_core_transport.h> 24 + #include <target/target_core_fabric.h> 25 25 26 26 #include "iscsi_target_core.h" 27 27 #include "iscsi_target_seq_pdu_list.h"
+1 -3
drivers/target/iscsi/iscsi_target_tpg.c
··· 19 19 ******************************************************************************/ 20 20 21 21 #include <target/target_core_base.h> 22 - #include <target/target_core_transport.h> 23 - #include <target/target_core_fabric_ops.h> 22 + #include <target/target_core_fabric.h> 24 23 #include <target/target_core_configfs.h> 25 - #include <target/target_core_tpg.h> 26 24 27 25 #include "iscsi_target_core.h" 28 26 #include "iscsi_target_erl0.h"
+1 -3
drivers/target/iscsi/iscsi_target_util.c
··· 22 22 #include <scsi/scsi_tcq.h> 23 23 #include <scsi/iscsi_proto.h> 24 24 #include <target/target_core_base.h> 25 - #include <target/target_core_transport.h> 26 - #include <target/target_core_tmr.h> 27 - #include <target/target_core_fabric_ops.h> 25 + #include <target/target_core_fabric.h> 28 26 #include <target/target_core_configfs.h> 29 27 30 28 #include "iscsi_target_core.h"
+1 -6
drivers/target/loopback/tcm_loop.c
··· 33 33 #include <scsi/scsi_cmnd.h> 34 34 35 35 #include <target/target_core_base.h> 36 - #include <target/target_core_transport.h> 37 - #include <target/target_core_fabric_ops.h> 36 + #include <target/target_core_fabric.h> 38 37 #include <target/target_core_fabric_configfs.h> 39 - #include <target/target_core_fabric_lib.h> 40 38 #include <target/target_core_configfs.h> 41 - #include <target/target_core_device.h> 42 - #include <target/target_core_tpg.h> 43 - #include <target/target_core_tmr.h> 44 39 45 40 #include "tcm_loop.h" 46 41
+2 -3
drivers/target/target_core_alua.c
··· 32 32 #include <scsi/scsi_cmnd.h> 33 33 34 34 #include <target/target_core_base.h> 35 - #include <target/target_core_device.h> 36 - #include <target/target_core_transport.h> 37 - #include <target/target_core_fabric_ops.h> 35 + #include <target/target_core_backend.h> 36 + #include <target/target_core_fabric.h> 38 37 #include <target/target_core_configfs.h> 39 38 40 39 #include "target_core_internal.h"
+2 -2
drivers/target/target_core_cdb.c
··· 29 29 #include <scsi/scsi.h> 30 30 31 31 #include <target/target_core_base.h> 32 - #include <target/target_core_transport.h> 33 - #include <target/target_core_fabric_ops.h> 32 + #include <target/target_core_backend.h> 33 + #include <target/target_core_fabric.h> 34 34 35 35 #include "target_core_internal.h" 36 36 #include "target_core_ua.h"
+2 -3
drivers/target/target_core_configfs.c
··· 39 39 #include <linux/spinlock.h> 40 40 41 41 #include <target/target_core_base.h> 42 - #include <target/target_core_device.h> 43 - #include <target/target_core_transport.h> 44 - #include <target/target_core_fabric_ops.h> 42 + #include <target/target_core_backend.h> 43 + #include <target/target_core_fabric.h> 45 44 #include <target/target_core_fabric_configfs.h> 46 45 #include <target/target_core_configfs.h> 47 46 #include <target/configfs_macros.h>
+2 -4
drivers/target/target_core_device.c
··· 42 42 #include <scsi/scsi_device.h> 43 43 44 44 #include <target/target_core_base.h> 45 - #include <target/target_core_device.h> 46 - #include <target/target_core_tpg.h> 47 - #include <target/target_core_transport.h> 48 - #include <target/target_core_fabric_ops.h> 45 + #include <target/target_core_backend.h> 46 + #include <target/target_core_fabric.h> 49 47 50 48 #include "target_core_internal.h" 51 49 #include "target_core_alua.h"
+1 -4
drivers/target/target_core_fabric_configfs.c
··· 36 36 #include <linux/configfs.h> 37 37 38 38 #include <target/target_core_base.h> 39 - #include <target/target_core_device.h> 40 - #include <target/target_core_tpg.h> 41 - #include <target/target_core_transport.h> 42 - #include <target/target_core_fabric_ops.h> 39 + #include <target/target_core_fabric.h> 43 40 #include <target/target_core_fabric_configfs.h> 44 41 #include <target/target_core_configfs.h> 45 42 #include <target/configfs_macros.h>
+1 -4
drivers/target/target_core_fabric_lib.c
··· 34 34 #include <scsi/scsi_cmnd.h> 35 35 36 36 #include <target/target_core_base.h> 37 - #include <target/target_core_device.h> 38 - #include <target/target_core_transport.h> 39 - #include <target/target_core_fabric_lib.h> 40 - #include <target/target_core_fabric_ops.h> 37 + #include <target/target_core_fabric.h> 41 38 #include <target/target_core_configfs.h> 42 39 43 40 #include "target_core_internal.h"
+1 -2
drivers/target/target_core_file.c
··· 37 37 #include <scsi/scsi_host.h> 38 38 39 39 #include <target/target_core_base.h> 40 - #include <target/target_core_device.h> 41 - #include <target/target_core_transport.h> 40 + #include <target/target_core_backend.h> 42 41 43 42 #include "target_core_file.h" 44 43
+2 -3
drivers/target/target_core_hba.c
··· 37 37 #include <net/tcp.h> 38 38 39 39 #include <target/target_core_base.h> 40 - #include <target/target_core_device.h> 41 - #include <target/target_core_tpg.h> 42 - #include <target/target_core_transport.h> 40 + #include <target/target_core_backend.h> 41 + #include <target/target_core_fabric.h> 43 42 44 43 #include "target_core_internal.h" 45 44
+1 -2
drivers/target/target_core_iblock.c
··· 42 42 #include <scsi/scsi_host.h> 43 43 44 44 #include <target/target_core_base.h> 45 - #include <target/target_core_device.h> 46 - #include <target/target_core_transport.h> 45 + #include <target/target_core_backend.h> 47 46 48 47 #include "target_core_iblock.h" 49 48
+2 -5
drivers/target/target_core_pr.c
··· 33 33 #include <asm/unaligned.h> 34 34 35 35 #include <target/target_core_base.h> 36 - #include <target/target_core_device.h> 37 - #include <target/target_core_tmr.h> 38 - #include <target/target_core_tpg.h> 39 - #include <target/target_core_transport.h> 40 - #include <target/target_core_fabric_ops.h> 36 + #include <target/target_core_backend.h> 37 + #include <target/target_core_fabric.h> 41 38 #include <target/target_core_configfs.h> 42 39 43 40 #include "target_core_internal.h"
+1 -2
drivers/target/target_core_pscsi.c
··· 44 44 #include <scsi/scsi_tcq.h> 45 45 46 46 #include <target/target_core_base.h> 47 - #include <target/target_core_device.h> 48 - #include <target/target_core_transport.h> 47 + #include <target/target_core_backend.h> 49 48 50 49 #include "target_core_pscsi.h" 51 50
+1 -3
drivers/target/target_core_rd.c
··· 37 37 #include <scsi/scsi_host.h> 38 38 39 39 #include <target/target_core_base.h> 40 - #include <target/target_core_device.h> 41 - #include <target/target_core_transport.h> 42 - #include <target/target_core_fabric_ops.h> 40 + #include <target/target_core_backend.h> 43 41 44 42 #include "target_core_rd.h" 45 43
+2 -2
drivers/target/target_core_stat.c
··· 43 43 #include <scsi/scsi_host.h> 44 44 45 45 #include <target/target_core_base.h> 46 - #include <target/target_core_transport.h> 47 - #include <target/target_core_fabric_ops.h> 46 + #include <target/target_core_backend.h> 47 + #include <target/target_core_fabric.h> 48 48 #include <target/target_core_configfs.h> 49 49 #include <target/configfs_macros.h> 50 50
+2 -4
drivers/target/target_core_tmr.c
··· 32 32 #include <scsi/scsi_cmnd.h> 33 33 34 34 #include <target/target_core_base.h> 35 - #include <target/target_core_device.h> 36 - #include <target/target_core_tmr.h> 37 - #include <target/target_core_transport.h> 38 - #include <target/target_core_fabric_ops.h> 35 + #include <target/target_core_backend.h> 36 + #include <target/target_core_fabric.h> 39 37 #include <target/target_core_configfs.h> 40 38 41 39 #include "target_core_internal.h"
+2 -4
drivers/target/target_core_tpg.c
··· 39 39 #include <scsi/scsi_cmnd.h> 40 40 41 41 #include <target/target_core_base.h> 42 - #include <target/target_core_device.h> 43 - #include <target/target_core_tpg.h> 44 - #include <target/target_core_transport.h> 45 - #include <target/target_core_fabric_ops.h> 42 + #include <target/target_core_backend.h> 43 + #include <target/target_core_fabric.h> 46 44 47 45 #include "target_core_internal.h" 48 46
+2 -5
drivers/target/target_core_transport.c
··· 45 45 #include <scsi/scsi_tcq.h> 46 46 47 47 #include <target/target_core_base.h> 48 - #include <target/target_core_device.h> 49 - #include <target/target_core_tmr.h> 50 - #include <target/target_core_tpg.h> 51 - #include <target/target_core_transport.h> 52 - #include <target/target_core_fabric_ops.h> 48 + #include <target/target_core_backend.h> 49 + #include <target/target_core_fabric.h> 53 50 #include <target/target_core_configfs.h> 54 51 55 52 #include "target_core_internal.h"
+1 -3
drivers/target/target_core_ua.c
··· 30 30 #include <scsi/scsi_cmnd.h> 31 31 32 32 #include <target/target_core_base.h> 33 - #include <target/target_core_device.h> 34 - #include <target/target_core_transport.h> 35 - #include <target/target_core_fabric_ops.h> 33 + #include <target/target_core_fabric.h> 36 34 #include <target/target_core_configfs.h> 37 35 38 36 #include "target_core_internal.h"
+1 -5
drivers/target/tcm_fc/tfc_cmd.c
··· 39 39 #include <scsi/fc_encode.h> 40 40 41 41 #include <target/target_core_base.h> 42 - #include <target/target_core_transport.h> 43 - #include <target/target_core_fabric_ops.h> 44 - #include <target/target_core_device.h> 45 - #include <target/target_core_tpg.h> 42 + #include <target/target_core_fabric.h> 46 43 #include <target/target_core_configfs.h> 47 - #include <target/target_core_tmr.h> 48 44 #include <target/configfs_macros.h> 49 45 50 46 #include "tcm_fc.h"
+1 -5
drivers/target/tcm_fc/tfc_conf.c
··· 41 41 #include <scsi/libfc.h> 42 42 43 43 #include <target/target_core_base.h> 44 - #include <target/target_core_transport.h> 45 - #include <target/target_core_fabric_ops.h> 44 + #include <target/target_core_fabric.h> 46 45 #include <target/target_core_fabric_configfs.h> 47 - #include <target/target_core_fabric_lib.h> 48 - #include <target/target_core_device.h> 49 - #include <target/target_core_tpg.h> 50 46 #include <target/target_core_configfs.h> 51 47 #include <target/configfs_macros.h> 52 48
+1 -4
drivers/target/tcm_fc/tfc_io.c
··· 48 48 #include <scsi/fc_encode.h> 49 49 50 50 #include <target/target_core_base.h> 51 - #include <target/target_core_transport.h> 52 - #include <target/target_core_fabric_ops.h> 53 - #include <target/target_core_device.h> 54 - #include <target/target_core_tpg.h> 51 + #include <target/target_core_fabric.h> 55 52 #include <target/target_core_configfs.h> 56 53 #include <target/configfs_macros.h> 57 54
+1 -4
drivers/target/tcm_fc/tfc_sess.c
··· 40 40 #include <scsi/libfc.h> 41 41 42 42 #include <target/target_core_base.h> 43 - #include <target/target_core_transport.h> 44 - #include <target/target_core_fabric_ops.h> 45 - #include <target/target_core_device.h> 46 - #include <target/target_core_tpg.h> 43 + #include <target/target_core_fabric.h> 47 44 #include <target/target_core_configfs.h> 48 45 #include <target/configfs_macros.h> 49 46
+65
include/target/target_core_backend.h
··· 1 + #ifndef TARGET_CORE_BACKEND_H 2 + #define TARGET_CORE_BACKEND_H 3 + 4 + #define TRANSPORT_PLUGIN_PHBA_PDEV 1 5 + #define TRANSPORT_PLUGIN_VHBA_PDEV 2 6 + #define TRANSPORT_PLUGIN_VHBA_VDEV 3 7 + 8 + struct se_subsystem_api { 9 + struct list_head sub_api_list; 10 + 11 + char name[16]; 12 + struct module *owner; 13 + 14 + u8 transport_type; 15 + 16 + unsigned int fua_write_emulated : 1; 17 + unsigned int write_cache_emulated : 1; 18 + 19 + int (*attach_hba)(struct se_hba *, u32); 20 + void (*detach_hba)(struct se_hba *); 21 + int (*pmode_enable_hba)(struct se_hba *, unsigned long); 22 + void *(*allocate_virtdevice)(struct se_hba *, const char *); 23 + struct se_device *(*create_virtdevice)(struct se_hba *, 24 + struct se_subsystem_dev *, void *); 25 + void (*free_device)(void *); 26 + int (*transport_complete)(struct se_task *task); 27 + struct se_task *(*alloc_task)(unsigned char *cdb); 28 + int (*do_task)(struct se_task *); 29 + int (*do_discard)(struct se_device *, sector_t, u32); 30 + void (*do_sync_cache)(struct se_task *); 31 + void (*free_task)(struct se_task *); 32 + ssize_t (*check_configfs_dev_params)(struct se_hba *, 33 + struct se_subsystem_dev *); 34 + ssize_t (*set_configfs_dev_params)(struct se_hba *, 35 + struct se_subsystem_dev *, const char *, ssize_t); 36 + ssize_t (*show_configfs_dev_params)(struct se_hba *, 37 + struct se_subsystem_dev *, char *); 38 + u32 (*get_device_rev)(struct se_device *); 39 + u32 (*get_device_type)(struct se_device *); 40 + sector_t (*get_blocks)(struct se_device *); 41 + unsigned char *(*get_sense_buffer)(struct se_task *); 42 + }; 43 + 44 + int transport_subsystem_register(struct se_subsystem_api *); 45 + void transport_subsystem_release(struct se_subsystem_api *); 46 + 47 + struct se_device *transport_add_device_to_core_hba(struct se_hba *, 48 + struct se_subsystem_api *, struct se_subsystem_dev *, u32, 49 + void *, struct se_dev_limits *, const char *, const char *); 50 + 51 + void transport_complete_sync_cache(struct se_cmd *, int); 52 + void transport_complete_task(struct se_task *, int); 53 + 54 + void target_get_task_cdb(struct se_task *, unsigned char *); 55 + 56 + void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); 57 + int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); 58 + int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *); 59 + int transport_set_vpd_ident(struct t10_vpd *, unsigned char *); 60 + 61 + /* core helpers also used by command snooping in pscsi */ 62 + void *transport_kmap_first_data_page(struct se_cmd *); 63 + void transport_kunmap_first_data_page(struct se_cmd *); 64 + 65 + #endif /* TARGET_CORE_BACKEND_H */
+91
include/target/target_core_base.h
··· 10 10 #include <net/tcp.h> 11 11 12 12 #define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml" 13 + #define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION 13 14 14 15 /* Maximum Number of LUNs per Target Portal Group */ 15 16 /* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */ ··· 53 52 #define INQUIRY_VPD_SERIAL_LEN 254 54 53 /* Used by transport_get_inquiry_vpd_device_ident() */ 55 54 #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254 55 + 56 + /* Attempts before moving from SHORT to LONG */ 57 + #define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3 58 + #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */ 59 + #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */ 60 + 61 + #define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */ 62 + 63 + /* 64 + * struct se_subsystem_dev->su_dev_flags 65 + */ 66 + #define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001 67 + #define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002 68 + #define SDF_USING_UDEV_PATH 0x00000004 69 + #define SDF_USING_ALIAS 0x00000008 70 + 71 + /* 72 + * struct se_device->dev_flags 73 + */ 74 + #define DF_READ_ONLY 0x00000001 75 + #define DF_SPC2_RESERVATIONS 0x00000002 76 + #define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004 77 + 78 + /* struct se_dev_attrib sanity values */ 79 + /* Default max_unmap_lba_count */ 80 + #define DA_MAX_UNMAP_LBA_COUNT 0 81 + /* Default max_unmap_block_desc_count */ 82 + #define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0 83 + /* Default unmap_granularity */ 84 + #define DA_UNMAP_GRANULARITY_DEFAULT 0 85 + /* Default unmap_granularity_alignment */ 86 + #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 87 + /* Emulation for Direct Page Out */ 88 + #define DA_EMULATE_DPO 0 89 + /* Emulation for Forced Unit Access WRITEs */ 90 + #define DA_EMULATE_FUA_WRITE 1 91 + /* Emulation for Forced Unit Access READs */ 92 + #define DA_EMULATE_FUA_READ 0 93 + /* Emulation for WriteCache and SYNCHRONIZE_CACHE */ 94 + #define DA_EMULATE_WRITE_CACHE 0 95 + /* Emulation for UNIT ATTENTION Interlock Control */ 96 + #define DA_EMULATE_UA_INTLLCK_CTRL 0 97 + /* Emulation for TASK_ABORTED status (TAS) by default */ 98 + #define DA_EMULATE_TAS 1 99 + /* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */ 100 + #define DA_EMULATE_TPU 0 101 + /* 102 + * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using 103 + * block/blk-lib.c:blkdev_issue_discard() 104 + */ 105 + #define DA_EMULATE_TPWS 0 106 + /* No Emulation for PSCSI by default */ 107 + #define DA_EMULATE_RESERVATIONS 0 108 + /* No Emulation for PSCSI by default */ 109 + #define DA_EMULATE_ALUA 0 110 + /* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ 111 + #define DA_ENFORCE_PR_ISIDS 1 112 + #define DA_STATUS_MAX_SECTORS_MIN 16 113 + #define DA_STATUS_MAX_SECTORS_MAX 8192 114 + /* By default don't report non-rotating (solid state) medium */ 115 + #define DA_IS_NONROT 0 116 + /* Queue Algorithm Modifier default for restricted reordering in control mode page */ 117 + #define DA_EMULATE_REST_REORD 0 118 + 119 + #define SE_MODE_PAGE_BUF 512 120 + 56 121 57 122 /* struct se_hba->hba_flags */ 58 123 enum hba_flags_table { ··· 223 156 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, 224 157 TCM_CHECK_CONDITION_NOT_READY = 0x0f, 225 158 TCM_RESERVATION_CONFLICT = 0x10, 159 + }; 160 + 161 + /* fabric independent task management function values */ 162 + enum tcm_tmreq_table { 163 + TMR_ABORT_TASK = 1, 164 + TMR_ABORT_TASK_SET = 2, 165 + TMR_CLEAR_ACA = 3, 166 + TMR_CLEAR_TASK_SET = 4, 167 + TMR_LUN_RESET = 5, 168 + TMR_TARGET_WARM_RESET = 6, 169 + TMR_TARGET_COLD_RESET = 7, 170 + TMR_FABRIC_TMR = 255, 171 + }; 172 + 173 + /* fabric independent task management response values */ 174 + enum tcm_tmrsp_table { 175 + TMR_FUNCTION_COMPLETE = 0, 176 + TMR_TASK_DOES_NOT_EXIST = 1, 177 + TMR_LUN_DOES_NOT_EXIST = 2, 178 + TMR_TASK_STILL_ALLEGIANT = 3, 179 + TMR_TASK_FAILOVER_NOT_SUPPORTED = 4, 180 + TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5, 181 + TMR_FUNCTION_AUTHORIZATION_FAILED = 6, 182 + TMR_FUNCTION_REJECTED = 255, 226 183 }; 227 184 228 185 struct se_obj {
-9
include/target/target_core_device.h
··· 1 - #ifndef TARGET_CORE_DEVICE_H 2 - #define TARGET_CORE_DEVICE_H 3 - 4 - 5 - // external 6 - extern int transport_lookup_cmd_lun(struct se_cmd *, u32); 7 - extern int transport_lookup_tmr_lun(struct se_cmd *, u32); 8 - 9 - #endif /* TARGET_CORE_DEVICE_H */
-28
include/target/target_core_fabric_lib.h
··· 1 - #ifndef TARGET_CORE_FABRIC_LIB_H 2 - #define TARGET_CORE_FABRIC_LIB_H 3 - 4 - extern u8 sas_get_fabric_proto_ident(struct se_portal_group *); 5 - extern u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 6 - struct t10_pr_registration *, int *, unsigned char *); 7 - extern u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 8 - struct t10_pr_registration *, int *); 9 - extern char *sas_parse_pr_out_transport_id(struct se_portal_group *, 10 - const char *, u32 *, char **); 11 - 12 - extern u8 fc_get_fabric_proto_ident(struct se_portal_group *); 13 - extern u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 14 - struct t10_pr_registration *, int *, unsigned char *); 15 - extern u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 16 - struct t10_pr_registration *, int *); 17 - extern char *fc_parse_pr_out_transport_id(struct se_portal_group *, 18 - const char *, u32 *, char **); 19 - 20 - extern u8 iscsi_get_fabric_proto_ident(struct se_portal_group *); 21 - extern u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 22 - struct t10_pr_registration *, int *, unsigned char *); 23 - extern u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 24 - struct t10_pr_registration *, int *); 25 - extern char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, 26 - const char *, u32 *, char **); 27 - 28 - #endif /* TARGET_CORE_FABRIC_LIB_H */
+86 -2
include/target/target_core_fabric_ops.h include/target/target_core_fabric.h
··· 1 - /* Defined in target_core_configfs.h */ 2 - struct target_fabric_configfs; 1 + #ifndef TARGET_CORE_FABRIC_H 2 + #define TARGET_CORE_FABRIC_H 3 3 4 4 struct target_core_fabric_ops { 5 5 struct configfs_subsystem *tf_subsys; ··· 103 103 struct config_group *, const char *); 104 104 void (*fabric_drop_nodeacl)(struct se_node_acl *); 105 105 }; 106 + 107 + struct se_session *transport_init_session(void); 108 + void __transport_register_session(struct se_portal_group *, 109 + struct se_node_acl *, struct se_session *, void *); 110 + void transport_register_session(struct se_portal_group *, 111 + struct se_node_acl *, struct se_session *, void *); 112 + void transport_free_session(struct se_session *); 113 + void transport_deregister_session_configfs(struct se_session *); 114 + void transport_deregister_session(struct se_session *); 115 + 116 + 117 + void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, 118 + struct se_session *, u32, int, int, unsigned char *); 119 + int transport_lookup_cmd_lun(struct se_cmd *, u32); 120 + int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 121 + int transport_handle_cdb_direct(struct se_cmd *); 122 + int transport_generic_handle_cdb_map(struct se_cmd *); 123 + int transport_generic_handle_data(struct se_cmd *); 124 + int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, 125 + struct scatterlist *, u32, struct scatterlist *, u32); 126 + void transport_do_task_sg_chain(struct se_cmd *); 127 + int transport_generic_new_cmd(struct se_cmd *); 128 + 129 + void transport_generic_process_write(struct se_cmd *); 130 + 131 + void transport_generic_free_cmd(struct se_cmd *, int); 132 + 133 + bool transport_wait_for_tasks(struct se_cmd *); 134 + int transport_check_aborted_status(struct se_cmd *, int); 135 + int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 136 + 137 + void target_get_sess_cmd(struct se_session *, struct se_cmd *); 138 + int target_put_sess_cmd(struct se_session *, struct se_cmd *); 139 + void target_splice_sess_cmd_list(struct se_session *); 140 + void target_wait_for_sess_cmds(struct se_session *, int); 141 + 142 + int core_alua_check_nonop_delay(struct se_cmd *); 143 + 144 + struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 145 + void core_tmr_release_req(struct se_tmr_req *); 146 + int transport_generic_handle_tmr(struct se_cmd *); 147 + int transport_lookup_tmr_lun(struct se_cmd *, u32); 148 + 149 + struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, 150 + unsigned char *); 151 + void core_tpg_clear_object_luns(struct se_portal_group *); 152 + struct se_node_acl *core_tpg_add_initiator_node_acl(struct se_portal_group *, 153 + struct se_node_acl *, const char *, u32); 154 + int core_tpg_del_initiator_node_acl(struct se_portal_group *, 155 + struct se_node_acl *, int); 156 + int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *, 157 + unsigned char *, u32, int); 158 + int core_tpg_register(struct target_core_fabric_ops *, struct se_wwn *, 159 + struct se_portal_group *, void *, int); 160 + int core_tpg_deregister(struct se_portal_group *); 161 + 162 + /* SAS helpers */ 163 + u8 sas_get_fabric_proto_ident(struct se_portal_group *); 164 + u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 165 + struct t10_pr_registration *, int *, unsigned char *); 166 + u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 167 + struct t10_pr_registration *, int *); 168 + char *sas_parse_pr_out_transport_id(struct se_portal_group *, const char *, 169 + u32 *, char **); 170 + 171 + /* FC helpers */ 172 + u8 fc_get_fabric_proto_ident(struct se_portal_group *); 173 + u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 174 + struct t10_pr_registration *, int *, unsigned char *); 175 + u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 176 + struct t10_pr_registration *, int *); 177 + char *fc_parse_pr_out_transport_id(struct se_portal_group *, const char *, 178 + u32 *, char **); 179 + 180 + /* iSCSI helpers */ 181 + u8 iscsi_get_fabric_proto_ident(struct se_portal_group *); 182 + u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, 183 + struct t10_pr_registration *, int *, unsigned char *); 184 + u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, 185 + struct t10_pr_registration *, int *); 186 + char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, const char *, 187 + u32 *, char **); 188 + 189 + #endif /* TARGET_CORE_FABRICH */
-31
include/target/target_core_tmr.h
··· 1 - #ifndef TARGET_CORE_TMR_H 2 - #define TARGET_CORE_TMR_H 3 - 4 - /* fabric independent task management function values */ 5 - enum tcm_tmreq_table { 6 - TMR_ABORT_TASK = 1, 7 - TMR_ABORT_TASK_SET = 2, 8 - TMR_CLEAR_ACA = 3, 9 - TMR_CLEAR_TASK_SET = 4, 10 - TMR_LUN_RESET = 5, 11 - TMR_TARGET_WARM_RESET = 6, 12 - TMR_TARGET_COLD_RESET = 7, 13 - TMR_FABRIC_TMR = 255, 14 - }; 15 - 16 - /* fabric independent task management response values */ 17 - enum tcm_tmrsp_table { 18 - TMR_FUNCTION_COMPLETE = 0, 19 - TMR_TASK_DOES_NOT_EXIST = 1, 20 - TMR_LUN_DOES_NOT_EXIST = 2, 21 - TMR_TASK_STILL_ALLEGIANT = 3, 22 - TMR_TASK_FAILOVER_NOT_SUPPORTED = 4, 23 - TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5, 24 - TMR_FUNCTION_AUTHORIZATION_FAILED = 6, 25 - TMR_FUNCTION_REJECTED = 255, 26 - }; 27 - 28 - extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 29 - extern void core_tmr_release_req(struct se_tmr_req *); 30 - 31 - #endif /* TARGET_CORE_TMR_H */
-22
include/target/target_core_tpg.h
··· 1 - #ifndef TARGET_CORE_TPG_H 2 - #define TARGET_CORE_TPG_H 3 - 4 - extern struct se_node_acl *core_tpg_check_initiator_node_acl( 5 - struct se_portal_group *, 6 - unsigned char *); 7 - extern void core_tpg_clear_object_luns(struct se_portal_group *); 8 - extern struct se_node_acl *core_tpg_add_initiator_node_acl( 9 - struct se_portal_group *, 10 - struct se_node_acl *, 11 - const char *, u32); 12 - extern int core_tpg_del_initiator_node_acl(struct se_portal_group *, 13 - struct se_node_acl *, int); 14 - extern int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *, 15 - unsigned char *, u32, int); 16 - extern int core_tpg_register(struct target_core_fabric_ops *, 17 - struct se_wwn *, 18 - struct se_portal_group *, void *, 19 - int); 20 - extern int core_tpg_deregister(struct se_portal_group *); 21 - 22 - #endif /* TARGET_CORE_TPG_H */
-256
include/target/target_core_transport.h
··· 1 - #ifndef TARGET_CORE_TRANSPORT_H 2 - #define TARGET_CORE_TRANSPORT_H 3 - 4 - #define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION 5 - 6 - /* Attempts before moving from SHORT to LONG */ 7 - #define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3 8 - #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */ 9 - #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */ 10 - 11 - #define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */ 12 - 13 - #define TRANSPORT_PLUGIN_PHBA_PDEV 1 14 - #define TRANSPORT_PLUGIN_VHBA_PDEV 2 15 - #define TRANSPORT_PLUGIN_VHBA_VDEV 3 16 - 17 - /* 18 - * struct se_subsystem_dev->su_dev_flags 19 - */ 20 - #define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001 21 - #define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002 22 - #define SDF_USING_UDEV_PATH 0x00000004 23 - #define SDF_USING_ALIAS 0x00000008 24 - 25 - /* 26 - * struct se_device->dev_flags 27 - */ 28 - #define DF_READ_ONLY 0x00000001 29 - #define DF_SPC2_RESERVATIONS 0x00000002 30 - #define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004 31 - 32 - /* struct se_dev_attrib sanity values */ 33 - /* Default max_unmap_lba_count */ 34 - #define DA_MAX_UNMAP_LBA_COUNT 0 35 - /* Default max_unmap_block_desc_count */ 36 - #define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0 37 - /* Default unmap_granularity */ 38 - #define DA_UNMAP_GRANULARITY_DEFAULT 0 39 - /* Default unmap_granularity_alignment */ 40 - #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 41 - /* Emulation for Direct Page Out */ 42 - #define DA_EMULATE_DPO 0 43 - /* Emulation for Forced Unit Access WRITEs */ 44 - #define DA_EMULATE_FUA_WRITE 1 45 - /* Emulation for Forced Unit Access READs */ 46 - #define DA_EMULATE_FUA_READ 0 47 - /* Emulation for WriteCache and SYNCHRONIZE_CACHE */ 48 - #define DA_EMULATE_WRITE_CACHE 0 49 - /* Emulation for UNIT ATTENTION Interlock Control */ 50 - #define DA_EMULATE_UA_INTLLCK_CTRL 0 51 - /* Emulation for TASK_ABORTED status (TAS) by default */ 52 - #define DA_EMULATE_TAS 1 53 - /* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */ 54 - #define DA_EMULATE_TPU 0 55 - /* 56 - * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using 57 - * block/blk-lib.c:blkdev_issue_discard() 58 - */ 59 - #define DA_EMULATE_TPWS 0 60 - /* No Emulation for PSCSI by default */ 61 - #define DA_EMULATE_RESERVATIONS 0 62 - /* No Emulation for PSCSI by default */ 63 - #define DA_EMULATE_ALUA 0 64 - /* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ 65 - #define DA_ENFORCE_PR_ISIDS 1 66 - #define DA_STATUS_MAX_SECTORS_MIN 16 67 - #define DA_STATUS_MAX_SECTORS_MAX 8192 68 - /* By default don't report non-rotating (solid state) medium */ 69 - #define DA_IS_NONROT 0 70 - /* Queue Algorithm Modifier default for restricted reordering in control mode page */ 71 - #define DA_EMULATE_REST_REORD 0 72 - 73 - #define SE_MODE_PAGE_BUF 512 74 - 75 - #define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs)) 76 - 77 - struct se_subsystem_api; 78 - 79 - extern int transport_subsystem_register(struct se_subsystem_api *); 80 - extern void transport_subsystem_release(struct se_subsystem_api *); 81 - extern struct se_session *transport_init_session(void); 82 - extern void __transport_register_session(struct se_portal_group *, 83 - struct se_node_acl *, 84 - struct se_session *, void *); 85 - extern void transport_register_session(struct se_portal_group *, 86 - struct se_node_acl *, 87 - struct se_session *, void *); 88 - extern void transport_free_session(struct se_session *); 89 - extern void transport_deregister_session_configfs(struct se_session *); 90 - extern void transport_deregister_session(struct se_session *); 91 - extern void transport_complete_sync_cache(struct se_cmd *, int); 92 - extern void transport_complete_task(struct se_task *, int); 93 - 94 - extern void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); 95 - extern int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); 96 - extern int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *); 97 - extern int transport_set_vpd_ident(struct t10_vpd *, unsigned char *); 98 - 99 - extern struct se_device *transport_add_device_to_core_hba(struct se_hba *, 100 - struct se_subsystem_api *, 101 - struct se_subsystem_dev *, u32, 102 - void *, struct se_dev_limits *, 103 - const char *, const char *); 104 - extern void transport_init_se_cmd(struct se_cmd *, 105 - struct target_core_fabric_ops *, 106 - struct se_session *, u32, int, int, 107 - unsigned char *); 108 - void *transport_kmap_first_data_page(struct se_cmd *cmd); 109 - void transport_kunmap_first_data_page(struct se_cmd *cmd); 110 - extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 111 - extern int transport_handle_cdb_direct(struct se_cmd *); 112 - extern int transport_generic_handle_cdb_map(struct se_cmd *); 113 - extern int transport_generic_handle_data(struct se_cmd *); 114 - extern int transport_generic_handle_tmr(struct se_cmd *); 115 - extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 116 - struct scatterlist *, u32); 117 - extern bool transport_wait_for_tasks(struct se_cmd *); 118 - extern int transport_check_aborted_status(struct se_cmd *, int); 119 - extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 120 - extern void transport_generic_free_cmd(struct se_cmd *, int); 121 - extern void target_get_sess_cmd(struct se_session *, struct se_cmd *); 122 - extern int target_put_sess_cmd(struct se_session *, struct se_cmd *); 123 - extern void target_splice_sess_cmd_list(struct se_session *); 124 - extern void target_wait_for_sess_cmds(struct se_session *, int); 125 - extern void transport_do_task_sg_chain(struct se_cmd *); 126 - extern void transport_generic_process_write(struct se_cmd *); 127 - extern int transport_generic_new_cmd(struct se_cmd *); 128 - /* From target_core_alua.c */ 129 - extern int core_alua_check_nonop_delay(struct se_cmd *); 130 - /* From target_core_cdb.c */ 131 - extern void target_get_task_cdb(struct se_task *task, unsigned char *cdb); 132 - 133 - /* 134 - * Each se_transport_task_t can have N number of possible struct se_task's 135 - * for the storage transport(s) to possibly execute. 136 - * Used primarily for splitting up CDBs that exceed the physical storage 137 - * HBA's maximum sector count per task. 138 - */ 139 - struct se_mem { 140 - struct page *se_page; 141 - u32 se_len; 142 - u32 se_off; 143 - struct list_head se_list; 144 - } ____cacheline_aligned; 145 - 146 - /* 147 - * Each type of disk transport supported MUST have a template defined 148 - * within its .h file. 149 - */ 150 - struct se_subsystem_api { 151 - /* 152 - * The Name. :-) 153 - */ 154 - char name[16]; 155 - /* 156 - * Transport Type. 157 - */ 158 - u8 transport_type; 159 - 160 - unsigned int fua_write_emulated : 1; 161 - unsigned int write_cache_emulated : 1; 162 - 163 - /* 164 - * struct module for struct se_hba references 165 - */ 166 - struct module *owner; 167 - /* 168 - * Used for global se_subsystem_api list_head 169 - */ 170 - struct list_head sub_api_list; 171 - /* 172 - * attach_hba(): 173 - */ 174 - int (*attach_hba)(struct se_hba *, u32); 175 - /* 176 - * detach_hba(): 177 - */ 178 - void (*detach_hba)(struct se_hba *); 179 - /* 180 - * pmode_hba(): Used for TCM/pSCSI subsystem plugin HBA -> 181 - * Linux/SCSI struct Scsi_Host passthrough 182 - */ 183 - int (*pmode_enable_hba)(struct se_hba *, unsigned long); 184 - /* 185 - * allocate_virtdevice(): 186 - */ 187 - void *(*allocate_virtdevice)(struct se_hba *, const char *); 188 - /* 189 - * create_virtdevice(): Only for Virtual HBAs 190 - */ 191 - struct se_device *(*create_virtdevice)(struct se_hba *, 192 - struct se_subsystem_dev *, void *); 193 - /* 194 - * free_device(): 195 - */ 196 - void (*free_device)(void *); 197 - 198 - /* 199 - * transport_complete(): 200 - * 201 - * Use transport_generic_complete() for majority of DAS transport 202 - * drivers. Provided out of convenience. 203 - */ 204 - int (*transport_complete)(struct se_task *task); 205 - struct se_task *(*alloc_task)(unsigned char *cdb); 206 - /* 207 - * do_task(): 208 - */ 209 - int (*do_task)(struct se_task *); 210 - /* 211 - * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate 212 - * UNMAP and WRITE_SAME_* w/ UNMAP=1 <-> Linux/Block Discard 213 - */ 214 - int (*do_discard)(struct se_device *, sector_t, u32); 215 - /* 216 - * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate 217 - * SYNCHRONIZE_CACHE_* <-> Linux/Block blkdev_issue_flush() 218 - */ 219 - void (*do_sync_cache)(struct se_task *); 220 - /* 221 - * free_task(): 222 - */ 223 - void (*free_task)(struct se_task *); 224 - /* 225 - * check_configfs_dev_params(): 226 - */ 227 - ssize_t (*check_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *); 228 - /* 229 - * set_configfs_dev_params(): 230 - */ 231 - ssize_t (*set_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, 232 - const char *, ssize_t); 233 - /* 234 - * show_configfs_dev_params(): 235 - */ 236 - ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, 237 - char *); 238 - /* 239 - * get_device_rev(): 240 - */ 241 - u32 (*get_device_rev)(struct se_device *); 242 - /* 243 - * get_device_type(): 244 - */ 245 - u32 (*get_device_type)(struct se_device *); 246 - /* 247 - * Get the sector_t from a subsystem backstore.. 248 - */ 249 - sector_t (*get_blocks)(struct se_device *); 250 - /* 251 - * get_sense_buffer(): 252 - */ 253 - unsigned char *(*get_sense_buffer)(struct se_task *); 254 - } ____cacheline_aligned; 255 - 256 - #endif /* TARGET_CORE_TRANSPORT_H */