⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initiator_error_rec.h

📁 iscsi源代码 UNH的progect 有initiator端和target端的源码
💻 H
字号:
/*	initiator/initiator_error_rec.h * *	vi: set autoindent tabstop=8 shiftwidth=8 : * *	This file contains auxilliary functions for iscsi initiator  *      code that are responsible for dealing with error recovery. * *	Copyright (C) 2001-2004 InterOperability Lab (IOL) *	University of New Hampshire (UNH) *	Durham, NH 03824 * *	This program is free software; you can redistribute it and/or modify *	it under the terms of the GNU General Public License as published by *	the Free Software Foundation; either version 2, or (at your option) *	any later version. * *	This program is distributed in the hope that it will be useful, *	but WITHOUT ANY WARRANTY; without even the implied warranty of *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *	GNU General Public License for more details. * *	You should have received a copy of the GNU General Public License *	along with this program; if not, write to the Free Software *	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, *	USA. * *	The name of IOL and/or UNH may not be used to endorse or promote  *	products derived from this software without specific prior  * 	written permission.*/#ifndef	_INITIATOR_ERROR_REC_H#define	_INITIATOR_ERROR_REC_H#define STATUS_BIT			0x01#define SNACK_RJT_BIT			0x02#define STATUS_CONNREC			0x4#define STATUS_LOGGED_OUT		0x5struct sess_rec_cmnd {	struct scsi_cmnd *Cmnd;	struct sess_rec_cmnd *next;};struct sess_rec_group {	struct sess_rec_cmnd *cmnd_list_head;	struct sess_rec_cmnd *cmnd_list_tail;	struct sess_rec_group *next;};/*************************************************************************	The Main Error Recovery Handler Called from iscsi_initiator when it*	finds any error.*	Returns >0 on success*			=0 on failure, session lock is locked*			<0 on failure, session lock is NOT locked************************************************************************/int init_do_error_recovery(struct init_error_rec *err_rec);/************************************************************************* This function handles the session recovery. It creates a recovery     ** thread that will do session recovery.                                 *************************************************************************/int init_session_recovery(struct init_error_rec *err_rec);/* Find an existing recovery session, if any *//* Returns pointer to it if found, else NULL */struct session *find_rec_sess(__u32 target_id);/* Create a new recovery session for the failing session before cleaning-up   the failing session */struct session *get_rec_sess(__u32 target_id, __u32 lun, __u32 ip, __u32 port,			     __u32 cid);/************************************************************************* This thread handles the session recovery. Session Recovery will       ** abort all pending tasks and closes all transport connection           ** Section (6.12.4)                                                      *************************************************************************/void init_recovery_thread(void *arg);/************************************************************************* This function handles the digest errors and sequence errors that may  ** have caused because of previous digest errors.                        *************************************************************************/int init_digest_recovery(struct init_error_rec *err_rec);/********************************************************************************       Called to send a SNACK Request to target for retransmission of*       numbered-responses, data, or R2T PDU.*		Returns 1 if all ok, 0 on any error*******************************************************************************/int init_send_snack(struct init_error_rec *err_rec, int begrun, int runlen,		    __u8 type);/******************************************************************* Deal with the Connection Recovery after Time2Wait expires******************************************************************/int deal_with_connrec(struct connection *fail_connection);/***************************************************************	Start Time2Wait Timer for Connection Recovery***************************************************************/void start_connrec_timer(struct session *current_session,			 struct semaphore *rec_wait_sem, __u32 period);void restore_global_data(struct iscsi_targetdata *target_data);struct sess_rec_group *set_rec_group(struct scsi_cmnd * Cmnd);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -