include/scsi/libiscsi.h
Source file repositories/reference/linux-study-clean/include/scsi/libiscsi.h
File Facts
- System
- Linux kernel
- Corpus path
include/scsi/libiscsi.h- Extension
.h- Size
- 14964 bytes
- Lines
- 515
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/wait.hlinux/mutex.hlinux/timer.hlinux/workqueue.hlinux/kfifo.hlinux/refcount.hscsi/iscsi_proto.hscsi/iscsi_if.hscsi/scsi_cmnd.hscsi/scsi_transport_iscsi.h
Detected Declarations
struct scsi_transport_templatestruct scsi_host_templatestruct scsi_devicestruct Scsi_Hoststruct scsi_targetstruct scsi_cmndstruct socketstruct iscsi_transportstruct iscsi_cls_sessionstruct iscsi_cls_connstruct iscsi_sessionstruct iscsi_nopinstruct devicestruct iscsi_r2t_infostruct iscsi_taskstruct iscsi_cmdstruct iscsi_connstruct iscsi_poolstruct iscsi_sessionstruct iscsi_hostfunction iscsi_task_has_unsol_datafunction iscsi_next_hdrfunction iscsi_task_is_completedfunction iscsi_paddedfunction iscsi_padding
Annotated Snippet
struct iscsi_r2t_info {
__be32 ttt; /* copied from R2T */
__be32 exp_statsn; /* copied from R2T */
uint32_t data_length; /* copied from R2T */
uint32_t data_offset; /* copied from R2T */
int data_count; /* DATA-Out payload progress */
int datasn;
/* LLDs should set/update these values */
int sent; /* R2T sequence progress */
};
struct iscsi_task {
/*
* Because LLDs allocate their hdr differently, this is a pointer
* and length to that storage. It must be setup at session
* creation time.
*/
struct iscsi_hdr *hdr;
unsigned short hdr_max;
unsigned short hdr_len; /* accumulated size of hdr used */
/* copied values in case we need to send tmfs */
itt_t hdr_itt;
__be32 cmdsn;
struct scsi_lun lun;
int itt; /* this ITT */
unsigned imm_count; /* imm-data (bytes) */
/* offset in unsolicited stream (bytes); */
struct iscsi_r2t_info unsol_r2t;
char *data; /* mgmt payload */
unsigned data_count;
struct scsi_cmnd *sc; /* associated SCSI cmd*/
struct iscsi_conn *conn; /* used connection */
/* data processing tracking */
unsigned long last_xfer;
unsigned long last_timeout;
bool have_checked_conn;
/* T10 protection information */
bool protected;
/* state set/tested under session->lock */
int state;
refcount_t refcount;
struct list_head running; /* running cmd list */
void *dd_data; /* driver/transport data */
};
static inline int iscsi_task_has_unsol_data(struct iscsi_task *task)
{
return task->unsol_r2t.data_length > task->unsol_r2t.sent;
}
static inline void* iscsi_next_hdr(struct iscsi_task *task)
{
return (void*)task->hdr + task->hdr_len;
}
static inline bool iscsi_task_is_completed(struct iscsi_task *task)
{
return task->state == ISCSI_TASK_COMPLETED ||
task->state == ISCSI_TASK_ABRT_TMF ||
task->state == ISCSI_TASK_ABRT_SESS_RECOV;
}
/* Private data associated with struct scsi_cmnd. */
struct iscsi_cmd {
struct iscsi_task *task;
int age;
};
static inline struct iscsi_cmd *iscsi_cmd(struct scsi_cmnd *cmd)
{
return scsi_cmd_priv(cmd);
}
/* Connection's states */
enum {
ISCSI_CONN_INITIAL_STAGE,
ISCSI_CONN_STARTED,
ISCSI_CONN_STOPPED,
ISCSI_CONN_CLEANUP_WAIT,
};
struct iscsi_conn {
struct iscsi_cls_conn *cls_conn; /* ptr to class connection */
void *dd_data; /* iscsi_transport data */
struct iscsi_session *session; /* parent session */
Annotation
- Immediate include surface: `linux/types.h`, `linux/wait.h`, `linux/mutex.h`, `linux/timer.h`, `linux/workqueue.h`, `linux/kfifo.h`, `linux/refcount.h`, `scsi/iscsi_proto.h`.
- Detected declarations: `struct scsi_transport_template`, `struct scsi_host_template`, `struct scsi_device`, `struct Scsi_Host`, `struct scsi_target`, `struct scsi_cmnd`, `struct socket`, `struct iscsi_transport`, `struct iscsi_cls_session`, `struct iscsi_cls_conn`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.