Changes in 4.9.252 target: bounds check XCOPY segment descriptor list target: simplify XCOPY wwn->se_dev lookup helper target: use XCOPY segment descriptor CSCD IDs xcopy: loop over devices using idr helper scsi: target: Fix XCOPY NAA identifier lookup target: add XCOPY target/segment desc sense codes powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at net: ip: always refragment ip defragmented packets net: fix pmtu check in nopmtudisc mode vmlinux.lds.h: Add PGO and AutoFDO input sections drm/i915: Fix mismatch between misplaced vma check and vma insert ubifs: wbuf: Don't leak kernel memory to flash spi: pxa2xx: Fix use-after-free on unbind ARM: OMAP2+: omap_device: fix idling of devices during probe cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() dmaengine: xilinx_dma: check dma_async_device_register return value dmaengine: xilinx_dma: fix mixed_enum_type coverity warning wil6210: select CONFIG_CRC32 block: rsxx: select CONFIG_CRC32 iommu/intel: Fix memleak in intel_irq_remapping_alloc net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups wan: ds26522: select CONFIG_BITREVERSE KVM: arm64: Don't access PMCR_EL0 when no PMU is available block: fix use-after-free in disk_part_iter_next net: drop bogus skb with CHECKSUM_PARTIAL and offset beyond end of trimmed packet Linux 4.9.252 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ic275c99bd03b788c7fdfffb6ed8529b0556a044c
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
#define XCOPY_TARGET_DESC_LEN 32
|
|
#define XCOPY_SEGMENT_DESC_LEN 28
|
|
#define XCOPY_NAA_IEEE_REGEX_LEN 16
|
|
#define XCOPY_MAX_SECTORS 1024
|
|
|
|
enum xcopy_origin_list {
|
|
XCOL_SOURCE_RECV_OP = 0x01,
|
|
XCOL_DEST_RECV_OP = 0x02,
|
|
};
|
|
|
|
struct xcopy_pt_cmd;
|
|
|
|
struct xcopy_op {
|
|
int op_origin;
|
|
|
|
struct se_cmd *xop_se_cmd;
|
|
struct se_device *src_dev;
|
|
unsigned char src_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
|
|
struct se_device *dst_dev;
|
|
unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
|
|
unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
|
|
struct percpu_ref *remote_lun_ref;
|
|
|
|
sector_t src_lba;
|
|
sector_t dst_lba;
|
|
unsigned short stdi;
|
|
unsigned short dtdi;
|
|
unsigned short nolb;
|
|
unsigned int dbl;
|
|
|
|
struct xcopy_pt_cmd *src_pt_cmd;
|
|
struct xcopy_pt_cmd *dst_pt_cmd;
|
|
|
|
u32 xop_data_nents;
|
|
struct scatterlist *xop_data_sg;
|
|
struct work_struct xop_work;
|
|
};
|
|
|
|
/*
|
|
* Receive Copy Results Sevice Actions
|
|
*/
|
|
#define RCR_SA_COPY_STATUS 0x00
|
|
#define RCR_SA_RECEIVE_DATA 0x01
|
|
#define RCR_SA_OPERATING_PARAMETERS 0x03
|
|
#define RCR_SA_FAILED_SEGMENT_DETAILS 0x04
|
|
|
|
/*
|
|
* Receive Copy Results defs for Operating Parameters
|
|
*/
|
|
#define RCR_OP_MAX_TARGET_DESC_COUNT 0x2
|
|
#define RCR_OP_MAX_SG_DESC_COUNT 0x1
|
|
#define RCR_OP_MAX_DESC_LIST_LEN 1024
|
|
#define RCR_OP_MAX_SEGMENT_LEN 268435456 /* 256 MB */
|
|
#define RCR_OP_TOTAL_CONCURR_COPIES 0x1 /* Must be <= 16384 */
|
|
#define RCR_OP_MAX_CONCURR_COPIES 0x1 /* Must be <= 255 */
|
|
#define RCR_OP_DATA_SEG_GRAN_LOG2 9 /* 512 bytes in log 2 */
|
|
#define RCR_OP_INLINE_DATA_GRAN_LOG2 9 /* 512 bytes in log 2 */
|
|
#define RCR_OP_HELD_DATA_GRAN_LOG2 9 /* 512 bytes in log 2 */
|
|
|
|
extern int target_xcopy_setup_pt(void);
|
|
extern void target_xcopy_release_pt(void);
|
|
extern sense_reason_t target_do_xcopy(struct se_cmd *);
|
|
extern sense_reason_t target_do_receive_copy_results(struct se_cmd *);
|