Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

faulttol.c File Reference

#include "FsRtlP.h"

Go to the source code of this file.

Functions

NTSTATUS FsRtlBalanceReads (IN PDEVICE_OBJECT TargetDevice)
NTSTATUS FsRtlSyncVolumes (IN PDEVICE_OBJECT TargetDevice, IN PLARGE_INTEGER ByteOffset OPTIONAL, IN PLARGE_INTEGER ByteCount)


Function Documentation

NTSTATUS FsRtlBalanceReads IN PDEVICE_OBJECT  TargetDevice  ) 
 

Definition at line 31 of file faulttol.c.

References ASSERT, Event(), Executive, FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, Irp, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NTSTATUS(), NULL, and Status.

00037 : 00038 00039 This routine signals a device driver that it is now OK to start 00040 balancing reads from a mirrored drive. This is typically called 00041 after the file system determines that a volume is clean. 00042 00043 Arguments: 00044 00045 TargetDevice - Supplies the device to start balanced read from. 00046 00047 Return Value: 00048 00049 NTSTATUS - The result of the operation. This will be 00050 STATUS_INVALID_DEVICE_REQUEST is the volume is not a mirror. 00051 00052 --*/ 00053 00054 { 00055 PIRP Irp; 00056 KEVENT Event; 00057 IO_STATUS_BLOCK Iosb; 00058 NTSTATUS Status; 00059 00060 KeInitializeEvent( &Event, NotificationEvent, FALSE ); 00061 00062 Irp = IoBuildDeviceIoControlRequest( FT_BALANCED_READ_MODE, 00063 TargetDevice, 00064 NULL, 00065 0, 00066 NULL, 00067 0, 00068 FALSE, 00069 &Event, 00070 &Iosb ); 00071 00072 if ( Irp == NULL ) { 00073 00074 return STATUS_INSUFFICIENT_RESOURCES; 00075 } 00076 00077 Status = IoCallDriver( TargetDevice, Irp ); 00078 00079 00080 if (Status == STATUS_PENDING) { 00081 Status = KeWaitForSingleObject( &Event, 00082 Executive, 00083 KernelMode, 00084 FALSE, 00085 NULL ); 00086 00087 ASSERT( Status == STATUS_SUCCESS ); 00088 00089 Status = Iosb.Status; 00090 } 00091 00092 return Status; 00093 }

NTSTATUS FsRtlSyncVolumes IN PDEVICE_OBJECT  TargetDevice,
IN PLARGE_INTEGER ByteOffset  OPTIONAL,
IN PLARGE_INTEGER  ByteCount
 

Definition at line 96 of file faulttol.c.

References ASSERT, Event(), Executive, FALSE, IoBuildDeviceIoControlRequest(), IoCallDriver, Irp, KeInitializeEvent, KernelMode, KeWaitForSingleObject(), NTSTATUS(), NULL, Status, and TRUE.

00104 : 00105 00106 This routine signals a device driver that it must sync redundant 00107 members of a mirror from the primary member. This is typically 00108 called after the file system determines that a volume is dirty. 00109 00110 Arguments: 00111 00112 TargetDevice - Supplies the device to sync. 00113 00114 ByteOffset - If specified, gives the location to start syncing 00115 00116 ByteCount - Gives the byte count to sync. Ignored if StartingOffset 00117 not specified. 00118 00119 Return Value: 00120 00121 NTSTATUS - The result of the operation. This will be 00122 STATUS_INVALID_DEVICE_REQUEST is the volume is not a mirror. 00123 00124 --*/ 00125 00126 { 00127 00128 #if 0 // Mike Glass says we no longer need to do this. 3/3/94 00129 00130 PIRP Irp; 00131 KEVENT Event; 00132 IO_STATUS_BLOCK Iosb; 00133 NTSTATUS Status; 00134 BOOLEAN RangeSpecified; 00135 FT_SYNC_INFORMATION SyncInfo; 00136 00137 KeInitializeEvent( &Event, NotificationEvent, FALSE ); 00138 00139 // 00140 // If the user specified a range, capture it. 00141 // 00142 00143 if (ARGUMENT_PRESENT(ByteOffset)) { 00144 00145 SyncInfo.ByteOffset = *ByteOffset; 00146 SyncInfo.ByteCount = *ByteCount; 00147 00148 RangeSpecified = TRUE; 00149 00150 } else { 00151 00152 RangeSpecified = FALSE; 00153 } 00154 00155 Irp = IoBuildDeviceIoControlRequest( FT_SYNC_REDUNDANT_COPY, 00156 TargetDevice, 00157 RangeSpecified ? &SyncInfo : NULL, 00158 RangeSpecified ? 00159 sizeof(FT_SYNC_INFORMATION) : 0, 00160 NULL, 00161 0, 00162 FALSE, 00163 &Event, 00164 &Iosb ); 00165 00166 if ( Irp == NULL ) { 00167 00168 return STATUS_INSUFFICIENT_RESOURCES; 00169 } 00170 00171 Status = IoCallDriver( TargetDevice, Irp ); 00172 00173 00174 if (Status == STATUS_PENDING) { 00175 Status = KeWaitForSingleObject( &Event, 00176 Executive, 00177 KernelMode, 00178 FALSE, 00179 NULL ); 00180 00181 ASSERT( Status == STATUS_SUCCESS ); 00182 00183 Status = Iosb.Status; 00184 } 00185 00186 return Status; 00187 #else 00188 return STATUS_SUCCESS; 00189 00190 #endif //0 00191 }


Generated on Sat May 15 19:43:37 2004 for test by doxygen 1.3.7