Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
target_core_transport.c File Reference
#include <linux/net.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/blkdev.h>
#include <linux/spinlock.h>
#include <linux/kthread.h>
#include <linux/in.h>
#include <linux/cdrom.h>
#include <linux/module.h>
#include <linux/ratelimit.h>
#include <asm/unaligned.h>
#include <net/sock.h>
#include <net/tcp.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_tcq.h>
#include <target/target_core_base.h>
#include <target/target_core_backend.h>
#include <target/target_core_fabric.h>
#include <target/target_core_configfs.h>
#include "target_core_internal.h"
#include "target_core_alua.h"
#include "target_core_pr.h"
#include "target_core_ua.h"

Go to the source code of this file.

Functions

int init_se_kmem_caches (void)
 
void release_se_kmem_caches (void)
 
u32 scsi_get_new_index (scsi_index_t type)
 
void transport_subsystem_check_init (void)
 
struct se_sessiontransport_init_session (void)
 
 EXPORT_SYMBOL (transport_init_session)
 
void __transport_register_session (struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct se_session *se_sess, void *fabric_sess_ptr)
 
 EXPORT_SYMBOL (__transport_register_session)
 
void transport_register_session (struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct se_session *se_sess, void *fabric_sess_ptr)
 
 EXPORT_SYMBOL (transport_register_session)
 
void target_release_session (struct kref *kref)
 
void target_get_session (struct se_session *se_sess)
 
 EXPORT_SYMBOL (target_get_session)
 
void target_put_session (struct se_session *se_sess)
 
 EXPORT_SYMBOL (target_put_session)
 
void target_put_nacl (struct se_node_acl *nacl)
 
void transport_deregister_session_configfs (struct se_session *se_sess)
 
 EXPORT_SYMBOL (transport_deregister_session_configfs)
 
void transport_free_session (struct se_session *se_sess)
 
 EXPORT_SYMBOL (transport_free_session)
 
void transport_deregister_session (struct se_session *se_sess)
 
 EXPORT_SYMBOL (transport_deregister_session)
 
void transport_cmd_finish_abort (struct se_cmd *cmd, int remove)
 
void target_complete_cmd (struct se_cmd *cmd, u8 scsi_status)
 
 EXPORT_SYMBOL (target_complete_cmd)
 
unsigned chartransport_dump_cmd_direction (struct se_cmd *cmd)
 
void transport_dump_dev_state (struct se_device *dev, char *b, int *bl)
 
void transport_dump_vpd_proto_id (struct t10_vpd *vpd, unsigned char *p_buf, int p_buf_len)
 
void transport_set_vpd_proto_id (struct t10_vpd *vpd, unsigned char *page_83)
 
 EXPORT_SYMBOL (transport_set_vpd_proto_id)
 
int transport_dump_vpd_assoc (struct t10_vpd *vpd, unsigned char *p_buf, int p_buf_len)
 
int transport_set_vpd_assoc (struct t10_vpd *vpd, unsigned char *page_83)
 
 EXPORT_SYMBOL (transport_set_vpd_assoc)
 
int transport_dump_vpd_ident_type (struct t10_vpd *vpd, unsigned char *p_buf, int p_buf_len)
 
int transport_set_vpd_ident_type (struct t10_vpd *vpd, unsigned char *page_83)
 
 EXPORT_SYMBOL (transport_set_vpd_ident_type)
 
int transport_dump_vpd_ident (struct t10_vpd *vpd, unsigned char *p_buf, int p_buf_len)
 
int transport_set_vpd_ident (struct t10_vpd *vpd, unsigned char *page_83)
 
 EXPORT_SYMBOL (transport_set_vpd_ident)
 
struct se_devicetransport_add_device_to_core_hba (struct se_hba *hba, struct se_subsystem_api *transport, struct se_subsystem_dev *se_dev, u32 device_flags, void *transport_dev, struct se_dev_limits *dev_limits, const char *inquiry_prod, const char *inquiry_rev)
 
 EXPORT_SYMBOL (transport_add_device_to_core_hba)
 
int target_cmd_size_check (struct se_cmd *cmd, unsigned int size)
 
void transport_init_se_cmd (struct se_cmd *cmd, struct target_core_fabric_ops *tfo, struct se_session *se_sess, u32 data_length, int data_direction, int task_attr, unsigned char *sense_buffer)
 
 EXPORT_SYMBOL (transport_init_se_cmd)
 
int target_setup_cmd_from_cdb (struct se_cmd *cmd, unsigned char *cdb)
 
 EXPORT_SYMBOL (target_setup_cmd_from_cdb)
 
int transport_handle_cdb_direct (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_handle_cdb_direct)
 
int target_submit_cmd_map_sgls (struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *cdb, unsigned char *sense, u32 unpacked_lun, u32 data_length, int task_attr, int data_dir, int flags, struct scatterlist *sgl, u32 sgl_count, struct scatterlist *sgl_bidi, u32 sgl_bidi_count)
 
 EXPORT_SYMBOL (target_submit_cmd_map_sgls)
 
int target_submit_cmd (struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *cdb, unsigned char *sense, u32 unpacked_lun, u32 data_length, int task_attr, int data_dir, int flags)
 
 EXPORT_SYMBOL (target_submit_cmd)
 
int target_submit_tmr (struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *sense, u32 unpacked_lun, void *fabric_tmr_ptr, unsigned char tm_type, gfp_t gfp, unsigned int tag, int flags)
 
 EXPORT_SYMBOL (target_submit_tmr)
 
bool target_stop_cmd (struct se_cmd *cmd, unsigned long *flags)
 
void transport_generic_request_failure (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_generic_request_failure)
 
void target_execute_cmd (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (target_execute_cmd)
 
int transport_generic_map_mem_to_cmd (struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_count, struct scatterlist *sgl_bidi, u32 sgl_bidi_count)
 
 EXPORT_SYMBOL (transport_generic_map_mem_to_cmd)
 
voidtransport_kmap_data_sg (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_kmap_data_sg)
 
void transport_kunmap_data_sg (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_kunmap_data_sg)
 
int transport_generic_new_cmd (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_generic_new_cmd)
 
void transport_generic_free_cmd (struct se_cmd *cmd, int wait_for_tasks)
 
 EXPORT_SYMBOL (transport_generic_free_cmd)
 
int target_put_sess_cmd (struct se_session *se_sess, struct se_cmd *se_cmd)
 
 EXPORT_SYMBOL (target_put_sess_cmd)
 
void target_sess_cmd_list_set_waiting (struct se_session *se_sess)
 
 EXPORT_SYMBOL (target_sess_cmd_list_set_waiting)
 
void target_wait_for_sess_cmds (struct se_session *se_sess, int wait_for_tasks)
 
 EXPORT_SYMBOL (target_wait_for_sess_cmds)
 
int transport_clear_lun_from_sessions (struct se_lun *lun)
 
bool transport_wait_for_tasks (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_wait_for_tasks)
 
int transport_send_check_condition_and_sense (struct se_cmd *cmd, u8 reason, int from_transport)
 
 EXPORT_SYMBOL (transport_send_check_condition_and_sense)
 
int transport_check_aborted_status (struct se_cmd *cmd, int send_status)
 
 EXPORT_SYMBOL (transport_check_aborted_status)
 
void transport_send_task_abort (struct se_cmd *cmd)
 
int transport_generic_handle_tmr (struct se_cmd *cmd)
 
 EXPORT_SYMBOL (transport_generic_handle_tmr)
 

Variables

struct kmem_cachese_ua_cache
 
struct kmem_cachet10_pr_reg_cache
 
struct kmem_cachet10_alua_lu_gp_cache
 
struct kmem_cachet10_alua_lu_gp_mem_cache
 
struct kmem_cachet10_alua_tg_pt_gp_cache
 
struct kmem_cachet10_alua_tg_pt_gp_mem_cache
 

Function Documentation

void __transport_register_session ( struct se_portal_group se_tpg,
struct se_node_acl se_nacl,
struct se_session se_sess,
void fabric_sess_ptr 
)

Definition at line 239 of file target_core_transport.c.

EXPORT_SYMBOL ( transport_init_session  )
EXPORT_SYMBOL ( __transport_register_session  )
EXPORT_SYMBOL ( transport_register_session  )
EXPORT_SYMBOL ( target_get_session  )
EXPORT_SYMBOL ( target_put_session  )
EXPORT_SYMBOL ( transport_free_session  )
EXPORT_SYMBOL ( transport_deregister_session  )
EXPORT_SYMBOL ( target_complete_cmd  )
EXPORT_SYMBOL ( transport_set_vpd_proto_id  )
EXPORT_SYMBOL ( transport_set_vpd_assoc  )
EXPORT_SYMBOL ( transport_set_vpd_ident_type  )
EXPORT_SYMBOL ( transport_set_vpd_ident  )
EXPORT_SYMBOL ( transport_add_device_to_core_hba  )
EXPORT_SYMBOL ( transport_init_se_cmd  )
EXPORT_SYMBOL ( target_setup_cmd_from_cdb  )
EXPORT_SYMBOL ( transport_handle_cdb_direct  )
EXPORT_SYMBOL ( target_submit_cmd_map_sgls  )
EXPORT_SYMBOL ( target_submit_cmd  )
EXPORT_SYMBOL ( target_submit_tmr  )
EXPORT_SYMBOL ( transport_generic_request_failure  )
EXPORT_SYMBOL ( target_execute_cmd  )
EXPORT_SYMBOL ( transport_generic_map_mem_to_cmd  )
EXPORT_SYMBOL ( transport_kmap_data_sg  )
EXPORT_SYMBOL ( transport_kunmap_data_sg  )
EXPORT_SYMBOL ( transport_generic_new_cmd  )
EXPORT_SYMBOL ( transport_generic_free_cmd  )
EXPORT_SYMBOL ( target_put_sess_cmd  )
EXPORT_SYMBOL ( target_sess_cmd_list_set_waiting  )
EXPORT_SYMBOL ( target_wait_for_sess_cmds  )
EXPORT_SYMBOL ( transport_wait_for_tasks  )
EXPORT_SYMBOL ( transport_check_aborted_status  )
EXPORT_SYMBOL ( transport_generic_handle_tmr  )
int init_se_kmem_caches ( void  )

Definition at line 76 of file target_core_transport.c.

void release_se_kmem_caches ( void  )

Definition at line 161 of file target_core_transport.c.

u32 scsi_get_new_index ( scsi_index_t  type)

Definition at line 180 of file target_core_transport.c.

int target_cmd_size_check ( struct se_cmd cmd,
unsigned int  size 
)

Definition at line 1173 of file target_core_transport.c.

void target_complete_cmd ( struct se_cmd cmd,
u8  scsi_status 
)

Definition at line 587 of file target_core_transport.c.

void target_execute_cmd ( struct se_cmd cmd)

Definition at line 1815 of file target_core_transport.c.

void target_get_session ( struct se_session se_sess)

Definition at line 309 of file target_core_transport.c.

void target_put_nacl ( struct se_node_acl nacl)

Definition at line 335 of file target_core_transport.c.

int target_put_sess_cmd ( struct se_session se_sess,
struct se_cmd se_cmd 
)

Definition at line 2502 of file target_core_transport.c.

void target_put_session ( struct se_session se_sess)

Definition at line 315 of file target_core_transport.c.

void target_release_session ( struct kref kref)

Definition at line 300 of file target_core_transport.c.

void target_sess_cmd_list_set_waiting ( struct se_session se_sess)

Definition at line 2513 of file target_core_transport.c.

int target_setup_cmd_from_cdb ( struct se_cmd cmd,
unsigned char cdb 
)

Definition at line 1292 of file target_core_transport.c.

bool target_stop_cmd ( struct se_cmd cmd,
unsigned long flags 
)

Definition at line 1688 of file target_core_transport.c.

int target_submit_cmd ( struct se_cmd se_cmd,
struct se_session se_sess,
unsigned char cdb,
unsigned char sense,
u32  unpacked_lun,
u32  data_length,
int  task_attr,
int  data_dir,
int  flags 
)

Definition at line 1603 of file target_core_transport.c.

int target_submit_cmd_map_sgls ( struct se_cmd se_cmd,
struct se_session se_sess,
unsigned char cdb,
unsigned char sense,
u32  unpacked_lun,
u32  data_length,
int  task_attr,
int  data_dir,
int  flags,
struct scatterlist sgl,
u32  sgl_count,
struct scatterlist sgl_bidi,
u32  sgl_bidi_count 
)

Definition at line 1483 of file target_core_transport.c.

int target_submit_tmr ( struct se_cmd se_cmd,
struct se_session se_sess,
unsigned char sense,
u32  unpacked_lun,
void fabric_tmr_ptr,
unsigned char  tm_type,
gfp_t  gfp,
unsigned int  tag,
int  flags 
)

target_submit_tmr - lookup unpacked lun and submit uninitialized se_cmd for TMR CDBs

: command descriptor to submit : associated se_sess for endpoint : pointer to SCSI sense buffer : unpacked LUN to reference for struct se_lun : fabric context for TMR req : Type of TM request : gfp type for caller : referenced task tag for TMR_ABORT_TASK : submit cmd flags

Callable from all contexts.

Definition at line 1638 of file target_core_transport.c.

void target_wait_for_sess_cmds ( struct se_session se_sess,
int  wait_for_tasks 
)

Definition at line 2534 of file target_core_transport.c.

struct se_device* transport_add_device_to_core_hba ( struct se_hba hba,
struct se_subsystem_api transport,
struct se_subsystem_dev se_dev,
u32  device_flags,
void transport_dev,
struct se_dev_limits dev_limits,
const char inquiry_prod,
const char inquiry_rev 
)
read

Definition at line 1052 of file target_core_transport.c.

int transport_check_aborted_status ( struct se_cmd cmd,
int  send_status 
)

Definition at line 3045 of file target_core_transport.c.

int transport_clear_lun_from_sessions ( struct se_lun lun)

Definition at line 2726 of file target_core_transport.c.

void transport_cmd_finish_abort ( struct se_cmd cmd,
int  remove 
)

Definition at line 546 of file target_core_transport.c.

void transport_deregister_session ( struct se_session se_sess)

Definition at line 375 of file target_core_transport.c.

void transport_deregister_session_configfs ( struct se_session se_sess)

Definition at line 340 of file target_core_transport.c.

unsigned char* transport_dump_cmd_direction ( struct se_cmd cmd)

Definition at line 691 of file target_core_transport.c.

void transport_dump_dev_state ( struct se_device dev,
char b,
int bl 
)

Definition at line 709 of file target_core_transport.c.

int transport_dump_vpd_assoc ( struct t10_vpd vpd,
unsigned char p_buf,
int  p_buf_len 
)

Definition at line 810 of file target_core_transport.c.

int transport_dump_vpd_ident ( struct t10_vpd vpd,
unsigned char p_buf,
int  p_buf_len 
)

Definition at line 919 of file target_core_transport.c.

int transport_dump_vpd_ident_type ( struct t10_vpd vpd,
unsigned char p_buf,
int  p_buf_len 
)

Definition at line 858 of file target_core_transport.c.

void transport_dump_vpd_proto_id ( struct t10_vpd vpd,
unsigned char p_buf,
int  p_buf_len 
)

Definition at line 741 of file target_core_transport.c.

void transport_free_session ( struct se_session se_sess)

Definition at line 369 of file target_core_transport.c.

void transport_generic_free_cmd ( struct se_cmd cmd,
int  wait_for_tasks 
)

Definition at line 2419 of file target_core_transport.c.

int transport_generic_handle_tmr ( struct se_cmd cmd)

Definition at line 3139 of file target_core_transport.c.

int transport_generic_map_mem_to_cmd ( struct se_cmd cmd,
struct scatterlist sgl,
u32  sgl_count,
struct scatterlist sgl_bidi,
u32  sgl_bidi_count 
)

Definition at line 2216 of file target_core_transport.c.

int transport_generic_new_cmd ( struct se_cmd cmd)

Definition at line 2352 of file target_core_transport.c.

void transport_generic_request_failure ( struct se_cmd cmd)

Definition at line 1712 of file target_core_transport.c.

int transport_handle_cdb_direct ( struct se_cmd cmd)

Definition at line 1418 of file target_core_transport.c.

void transport_init_se_cmd ( struct se_cmd cmd,
struct target_core_fabric_ops tfo,
struct se_session se_sess,
u32  data_length,
int  data_direction,
int  task_attr,
unsigned char sense_buffer 
)

Definition at line 1229 of file target_core_transport.c.

struct se_session* transport_init_session ( void  )
read

Definition at line 216 of file target_core_transport.c.

void* transport_kmap_data_sg ( struct se_cmd cmd)

Definition at line 2251 of file target_core_transport.c.

void transport_kunmap_data_sg ( struct se_cmd cmd)

Definition at line 2292 of file target_core_transport.c.

void transport_register_session ( struct se_portal_group se_tpg,
struct se_node_acl se_nacl,
struct se_session se_sess,
void fabric_sess_ptr 
)

Definition at line 286 of file target_core_transport.c.

int transport_send_check_condition_and_sense ( struct se_cmd cmd,
u8  reason,
int  from_transport 
)

Definition at line 2853 of file target_core_transport.c.

void transport_send_task_abort ( struct se_cmd cmd)

Definition at line 3067 of file target_core_transport.c.

int transport_set_vpd_assoc ( struct t10_vpd vpd,
unsigned char page_83 
)

Definition at line 846 of file target_core_transport.c.

int transport_set_vpd_ident ( struct t10_vpd vpd,
unsigned char page_83 
)

Definition at line 958 of file target_core_transport.c.

int transport_set_vpd_ident_type ( struct t10_vpd vpd,
unsigned char page_83 
)

Definition at line 907 of file target_core_transport.c.

void transport_set_vpd_proto_id ( struct t10_vpd vpd,
unsigned char page_83 
)

Definition at line 795 of file target_core_transport.c.

void transport_subsystem_check_init ( void  )

Definition at line 193 of file target_core_transport.c.

bool transport_wait_for_tasks ( struct se_cmd cmd)

transport_wait_for_tasks - wait for completion to occur : command to wait

Called from frontend fabric context to wait for storage engine to pause and/or release frontend generated struct se_cmd.

Definition at line 2748 of file target_core_transport.c.

Variable Documentation

struct kmem_cache* se_ua_cache

Definition at line 60 of file target_core_transport.c.

struct kmem_cache* t10_alua_lu_gp_cache

Definition at line 62 of file target_core_transport.c.

struct kmem_cache* t10_alua_lu_gp_mem_cache

Definition at line 63 of file target_core_transport.c.

struct kmem_cache* t10_alua_tg_pt_gp_cache

Definition at line 64 of file target_core_transport.c.

struct kmem_cache* t10_alua_tg_pt_gp_mem_cache

Definition at line 65 of file target_core_transport.c.

struct kmem_cache* t10_pr_reg_cache

Definition at line 61 of file target_core_transport.c.