[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 03/10] Pass PXENVBD_SRBEXT, not PSCSI_REQUEST_BLOCK
From: Owen Smith <owen.smith@xxxxxxxxxx> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx> --- src/xenvbd/adapter.c | 16 ++++++++++------ src/xenvbd/adapter.h | 7 ++++--- src/xenvbd/target.c | 15 ++++++++------- src/xenvbd/target.h | 5 ++--- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c index ec6711a..bc93037 100644 --- a/src/xenvbd/adapter.c +++ b/src/xenvbd/adapter.c @@ -1396,10 +1396,12 @@ AdapterTeardown( VOID AdapterCompleteSrb( - IN PXENVBD_ADAPTER Adapter, - IN PSCSI_REQUEST_BLOCK Srb + IN PXENVBD_ADAPTER Adapter, + IN PXENVBD_SRBEXT SrbExt ) { + PSCSI_REQUEST_BLOCK Srb = SrbExt->Srb; + ASSERT3U(Srb->SrbStatus, !=, SRB_STATUS_PENDING); ++Adapter->Completed; @@ -1717,6 +1719,7 @@ AdapterHwBuildIo( ) { PXENVBD_ADAPTER Adapter = DevExt; + PXENVBD_SRBEXT SrbExt = Srb->SrbExtension; InitSrbExt(Srb); @@ -1746,7 +1749,7 @@ AdapterHwBuildIo( break; } - AdapterCompleteSrb(Adapter, Srb); + AdapterCompleteSrb(Adapter, SrbExt); return FALSE; } @@ -1759,6 +1762,7 @@ AdapterHwStartIo( ) { PXENVBD_ADAPTER Adapter = DevExt; + PXENVBD_SRBEXT SrbExt = Srb->SrbExtension; PXENVBD_TARGET Target; Target = AdapterGetTarget(Adapter, Srb->TargetId); @@ -1766,14 +1770,14 @@ AdapterHwStartIo( goto fail1; ++Adapter->StartIo; - if (TargetStartIo(Target, Srb)) - AdapterCompleteSrb(Adapter, Srb); + if (TargetStartIo(Target, SrbExt)) + AdapterCompleteSrb(Adapter, SrbExt); return TRUE; fail1: Srb->SrbStatus = SRB_STATUS_INVALID_TARGET_ID; - AdapterCompleteSrb(Adapter, Srb); + AdapterCompleteSrb(Adapter, SrbExt); return TRUE; } diff --git a/src/xenvbd/adapter.h b/src/xenvbd/adapter.h index b8706fd..a398b75 100644 --- a/src/xenvbd/adapter.h +++ b/src/xenvbd/adapter.h @@ -36,13 +36,14 @@ typedef struct _XENVBD_ADAPTER XENVBD_ADAPTER, *PXENVBD_ADAPTER; -#include <storport.h> #include <store_interface.h> #include <evtchn_interface.h> #include <gnttab_interface.h> #include <debug_interface.h> #include <suspend_interface.h> +#include "srbext.h" + #define ADAPTER_GET_INTERFACE(_name, _type) \ extern VOID \ AdapterGet ## _name ## Interface( \ @@ -66,8 +67,8 @@ AdapterIsTargetEmulated( extern VOID AdapterCompleteSrb( - IN PXENVBD_ADAPTER Adapter, - IN PSCSI_REQUEST_BLOCK Srb + IN PXENVBD_ADAPTER Adapter, + IN PXENVBD_SRBEXT SrbExt ); extern VOID diff --git a/src/xenvbd/target.c b/src/xenvbd/target.c index 5bab440..1f45afb 100644 --- a/src/xenvbd/target.c +++ b/src/xenvbd/target.c @@ -1297,7 +1297,7 @@ __TargetPauseDataPath( Verbose("Target[%d] : FreshSrb 0x%p -> SCSI_ABORTED\n", TargetGetTargetId(Target), SrbExt->Srb); SrbExt->Srb->SrbStatus = SRB_STATUS_ABORTED; SrbExt->Srb->ScsiStatus = 0x40; // SCSI_ABORTED; - AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt->Srb); + AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt); } // Fail PreparedReqs @@ -1317,7 +1317,7 @@ __TargetPauseDataPath( if (InterlockedDecrement(&SrbExt->Count) == 0) { SrbExt->Srb->ScsiStatus = 0x40; // SCSI_ABORTED - AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt->Srb); + AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt); } } } @@ -1429,7 +1429,7 @@ TargetCompleteShutdown( break; SrbExt = CONTAINING_RECORD(Entry, XENVBD_SRBEXT, Entry); SrbExt->Srb->SrbStatus = SRB_STATUS_SUCCESS; - AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt->Srb); + AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt); } } @@ -1526,7 +1526,7 @@ TargetCompleteResponse( Srb->ScsiStatus = 0x40; // SCSI_ABORTED } - AdapterCompleteSrb(TargetGetAdapter(Target), Srb); + AdapterCompleteSrb(TargetGetAdapter(Target), SrbExt); } } @@ -2129,13 +2129,14 @@ __ValidateSrbForTarget( return TRUE; } -__checkReturn BOOLEAN TargetStartIo( - __in PXENVBD_TARGET Target, - __in PSCSI_REQUEST_BLOCK Srb + IN PXENVBD_TARGET Target, + IN PXENVBD_SRBEXT SrbExt ) { + PSCSI_REQUEST_BLOCK Srb = SrbExt->Srb; + if (!__ValidateSrbForTarget(Target, Srb)) return TRUE; diff --git a/src/xenvbd/target.h b/src/xenvbd/target.h index 9455d56..67b6319 100644 --- a/src/xenvbd/target.h +++ b/src/xenvbd/target.h @@ -162,11 +162,10 @@ TargetReset( __in PXENVBD_TARGET Target ); -__checkReturn extern BOOLEAN TargetStartIo( - __in PXENVBD_TARGET Target, - __in PSCSI_REQUEST_BLOCK Srb + IN PXENVBD_TARGET Target, + IN PXENVBD_SRBEXT SrbExt ); extern VOID -- 2.8.3 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |