764{
769
771
775
779
781
786
790
792#ifndef __REACTOS__
794#endif
797
798
800
804
810
817
818 Irp = IrpContext->Irp;
820
823
827
828 if (PagingIo) {
830 }
831
832 DEBUG(
DL_INF, (
"Ext2WriteFile: %wZ Offset=%I64xh Length=%xh Paging=%xh Nocache=%xh\n",
834
838 }
839
844 }
845
847 Irp->IoStatus.Information = 0;
850 }
851
857 }
858
859 if (Nocache && !PagingIo &&
864 }
865
870 }
871
872 if (!Nocache) {
873
877
881 (bWait && bQueue),
882 bAgain ) ) {
883
885 IrpContext->Irp,
888
893 IrpContext,
896 bAgain );
900 }
901 }
902 }
903
907 }
908
910
912
914
917
919
921
925
927 RecursiveWriteThrough =
TRUE;
928 }
929 }
930 }
931
932 if (PagingIo) {
933
937 }
938 PagingIoResourceAcquired =
TRUE;
939
941
943
945 Irp->IoStatus.Information = 0;
947
948 } else {
949
953 }
954
955 } else {
956
958 }
959
960 } else {
961
965 }
966
969 }
970
974 }
975 MainResourceAcquired =
TRUE;
976
977
978
979
980 if (Nocache &&
Ccb !=
NULL &&
Fcb->SectionObject.DataSectionObject !=
NULL) {
981
984
990
994 }
995
998
1003 }
1004
1008 }
1009
1013 IrpContext,
1016
1020 }
1021
1022
1023
1024
1025
1027 }
1028
1029
1030
1031
1032
1034
1036
1040 }
1041 PagingIoResourceAcquired =
TRUE;
1042
1043
1045
1051
1052
1053
1060 }
1062 PagingIoResourceAcquired =
FALSE;
1063
1068 }
1070 }
1071
1074 }
1075
1078
1081 }
1082
1084 FileSizesChanged =
TRUE;
1085
1086 if (
Fcb->
Header.FileSize.QuadPart >= 0x80000000 &&
1090 }
1091
1092 DEBUG(
DL_IO, (
"Ext2WriteFile: expanding %wZ to FS: %I64xh FA: %I64xh\n",
1095 }
1096
1098 }
1099
1100 if (!Nocache) {
1101
1109
1113 }
1114
1116
1123
1125
1126 } else {
1127
1133 }
1134
1136
1137
1139
1142 if (!rc) {
1146 }
1147 }
1148
1155 }
1156 }
1157
1159
1162 } else {
1165 }
1166
1168 FileSizesChanged =
TRUE;
1169 }
1170
1172 }
1173
1177 DEBUG(
DL_FLP, (
"Ext2WriteFile is starting FlushingDpc...\n"));
1179 }
1180 }
1181
1182 } else {
1183
1186
1187
1192 if (!rc) {
1196 }
1197 }
1198 }
1199
1201 IrpContext->Irp,
1204
1207 }
1208
1211
1213 IrpContext,
1221 );
1222
1223 Irp = IrpContext->Irp;
1224
1226
1228
1229 FileSizesChanged =
TRUE;
1230
1232 if (!PagingIo)
1235 } else {
1238 }
1239
1242 }
1243
1244 DEBUG(
DL_IO, (
"Ext2WriteFile: %wZ written FS: %I64xh FA: %I64xh BO: %I64xh LEN: %u\n",
1247 }
1248 }
1249 }
1250
1251 if (FileSizesChanged) {
1256 }
1257
1259
1260
1261
1262
1263
1264
1265
1268
1270 if (PagingIoResourceAcquired) {
1272 }
1273
1274 if (MainResourceAcquired) {
1276 }
1277 }
1278
1279 if (!OpPostIrp && !IrpContext->ExceptionInProgress) {
1280
1282
1285
1286 if (!bDeferred) {
1288 }
1289
1290 } else {
1291
1293
1294 if (SynchronousIo) {
1297 }
1298
1301 }
1302
1304 }
1305 } else {
1307 }
1308 }
1310
1311 DEBUG(
DL_IO, (
"Ext2WriteFile: %wZ written at Offset=%I64xh Length=%xh PagingIo=%d Nocache=%d "
1312 "RetLen=%xh VDL=%I64xh FileSize=%I64xh i_size=%I64xh Status=%xh\n",
1316
1318}
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
#define READ_AHEAD_GRANULARITY
VOID NTAPI CcPrepareMdlWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
VOID NTAPI CcSetReadAheadGranularity(IN PFILE_OBJECT FileObject, IN ULONG Granularity)
#define CcIsFileCached(FO)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define IRP_CONTEXT_FLAG_WAIT
#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE
BOOLEAN Ext2ZeroData(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER Start, IN PLARGE_INTEGER End)
VOID Ext2StartFloppyFlushDpc(PEXT2_VCB Vcb, PEXT2_FCB Fcb, PFILE_OBJECT FileObject)
VOID Ext2DeferWrite(IN PEXT2_IRP_CONTEXT, PIRP Irp)
NTSTATUS Ext2WriteInode(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONGLONG Offset, IN PVOID Buffer, IN ULONG Size, IN BOOLEAN bDirectIo, OUT PULONG BytesWritten)
#define ExAcquireResourceSharedLite(res, wait)
#define ClearFlag(_F, _SF)
#define IsSpecialFile(Fcb)
VOID Ext2OplockComplete(IN PVOID Context, IN PIRP Irp)
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
#define IsFileDeleted(Mcb)
BOOLEAN Ext2SaveInode(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN struct inode *Inode)
#define FCB_ALLOC_IN_WRITE
#define SetLongFlag(_F, _SF)
#define FCB_FILE_MODIFIED
VOID Ext2FreeIrpContext(IN PEXT2_IRP_CONTEXT IrpContext)
NTSTATUS Ext2LockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
#define ClearLongFlag(_F, _SF)
PVOID Ext2GetUserBuffer(IN PIRP Irp)
VOID Ext2NotifyReportChange(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONG Filter, IN ULONG Action)
#define IsInodeSymLink(I)
BOOLEAN Ext2SaveSuper(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb)
#define IRP_CONTEXT_FLAG_DEFERRED
#define IRP_CONTEXT_FLAG_REQUEUED
VOID Ext2LockIrp(IN PVOID Context, IN PIRP Irp)
#define IsLazyWriter(Fcb)
#define IsWritingToEof(Pos)
NTSTATUS Ext2ExpandFile(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_MCB Mcb, PLARGE_INTEGER Size)
struct _EXT2_FCB * PEXT2_FCB
#define CEILING_ALIGNED(T, A, B)
int Ext2CheckFileAccess(PEXT2_VCB Vcb, PEXT2_MCB Mcb, int attempt)
FAST_IO_POSSIBLE Ext2IsFastIoPossible(IN PEXT2_FCB Fcb)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
BOOLEAN NTAPI FsRtlCheckLockForWriteAccess(IN PFILE_LOCK FileLock, IN PIRP Irp)
#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
#define FILE_USE_FILE_POINTER_POSITION
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN NTAPI CcCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN PVOID Buffer)
BOOLEAN NTAPI CcCanIWrite(IN PFILE_OBJECT FileObject, IN ULONG BytesToWrite, IN BOOLEAN Wait, IN UCHAR Retrying)
VOID NTAPI CcDeferWrite(IN PFILE_OBJECT FileObject, IN PCC_POST_DEFERRED_WRITE PostRoutine, IN PVOID Context1, IN PVOID Context2, IN ULONG BytesToWrite, IN BOOLEAN Retrying)
PIRP NTAPI IoGetTopLevelIrp(VOID)
#define STATUS_FILE_LOCK_CONFLICT
NTSTATUS NTAPI FsRtlCheckOplock(IN POPLOCK Oplock, IN PIRP Irp, IN PVOID Context, IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL, IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL)
CACHE_MANAGER_CALLBACKS CacheManagerCallbacks
NTFSIDENTIFIER Identifier
FSRTL_ADVANCED_FCB_HEADER Header
#define STATUS_FILE_DELETED
#define STATUS_INVALID_USER_BUFFER
VOID(NTAPI * PCC_POST_DEFERRED_WRITE)(_In_ PVOID Context1, _In_ PVOID Context2)
#define FILE_NOTIFY_CHANGE_SIZE
#define FILE_ACTION_MODIFIED
#define FO_FILE_SIZE_CHANGED
#define FO_SYNCHRONOUS_IO
#define IRP_SYNCHRONOUS_PAGING_IO
#define IRP_MJ_MAXIMUM_FUNCTION