MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2WriteInode

Function Ext2WriteInode

Ext4Fsd/write.c:651–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651NTSTATUS
652Ext2WriteInode (
653 IN PEXT2_IRP_CONTEXT IrpContext,
654 IN PEXT2_VCB Vcb,
655 IN PEXT2_MCB Mcb,
656 IN ULONGLONG Offset,
657 IN PVOID Buffer,
658 IN ULONG Size,
659 IN BOOLEAN bDirectIo,
660 OUT PULONG BytesWritten
661 )
662{
663 PEXT2_EXTENT Chain = NULL;
664 NTSTATUS Status = STATUS_UNSUCCESSFUL;
665
666 __try {
667
668 if (BytesWritten) {
669 *BytesWritten = 0;
670 }
671
672 Status = Ext2BuildExtents (
673 IrpContext,
674 Vcb,
675 Mcb,
676 Offset,
677 Size,
678 S_ISDIR(Mcb->Inode.i_mode) ? FALSE : TRUE,
679 &Chain
680 );
681
682 if (!NT_SUCCESS(Status)) {
683 __leave;
684 }
685
686 if (Chain == NULL) {
687 Status = STATUS_SUCCESS;
688 __leave;
689 }
690
691 if (bDirectIo) {
692
693 ASSERT(IrpContext != NULL);
694
695 //
696 // We assume the offset is aligned.
697 //
698
699 Status = Ext2ReadWriteBlocks(
700 IrpContext,
701 Vcb,
702 Chain,
703 Size
704 );
705
706 } else {
707
708 PEXT2_EXTENT Extent;

Callers 3

Ext2WriteSymlinkFunction · 0.85
Ext2WriteFileFunction · 0.85
Ext2SetParentEntryFunction · 0.85

Calls 5

Ext2BuildExtentsFunction · 0.85
Ext2ReadWriteBlocksFunction · 0.85
Ext2SaveBufferFunction · 0.85
Ext2StartFloppyFlushDpcFunction · 0.85
Ext2DestroyExtentChainFunction · 0.85

Tested by

no test coverage detected