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

Function Ext2SaveInode

Ext4Fsd/ext3/generic.c:559–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559BOOLEAN
560Ext2SaveInode ( IN PEXT2_IRP_CONTEXT IrpContext,
561 IN PEXT2_VCB Vcb,
562 IN struct inode *Inode)
563{
564 struct ext4_inode* ext4i;
565 struct ext4_inode_info unused = {0};
566 LONGLONG offset;
567 BOOLEAN rc = 0;
568
569 DEBUG(DL_INF, ( "Ext2SaveInode: Saving Inode %xh: Mode=%xh Size=%xh\n",
570 Inode->i_ino, Inode->i_mode, Inode->i_size));
571 rc = Ext2GetInodeLba(Vcb, Inode->i_ino, &offset);
572 if (!rc) {
573 DEBUG(DL_ERR, ( "Ext2SaveInode: failed inode %u.\n", Inode->i_ino));
574 goto errorout;
575 }
576
577 ext4i = (struct ext4_inode*) Ext2AllocatePool(NonPagedPool, EXT4_INODE_SIZE(Inode->i_sb), EXT2_INODE_MAGIC);
578 if (!ext4i) {
579 rc = FALSE;
580 goto errorout;
581 }
582
583 rc = Ext2LoadBuffer(NULL, Vcb, offset, EXT4_INODE_SIZE(Inode->i_sb), ext4i);
584 if (!rc) {
585 DEBUG(DL_ERR, ( "Ext2SaveInode: failed reading inode %u.\n", Inode->i_ino));
586 ExFreePool(ext4i);
587 goto errorout;
588 }
589
590 Ext2EncodeInode(ext4i, Inode);
591
592 ext4_inode_csum_set(Inode, ext4i, &unused);
593
594 rc = Ext2SaveBuffer(IrpContext, Vcb, offset, EXT4_INODE_SIZE(Inode->i_sb), ext4i);
595
596 if (rc && IsFlagOn(Vcb->Flags, VCB_FLOPPY_DISK)) {
597 Ext2StartFloppyFlushDpc(Vcb, NULL, NULL);
598 }
599
600 ExFreePool(ext4i);
601
602errorout:
603 return rc;
604}
605
606BOOLEAN
607Ext2LoadInodeXattr(IN PEXT2_VCB Vcb,

Callers 15

Ext2CleanupFunction · 0.85
Ext2FlushFileFunction · 0.85
Ext2WriteSymlinkFunction · 0.85
Ext2SetReparsePointFunction · 0.85
Ext2TruncateSymlinkFunction · 0.85
Ext2SetFileInformationFunction · 0.85
Ext2DeleteFileFunction · 0.85
Ext2CreateInodeFunction · 0.85
Ext2WriteFileFunction · 0.85
Ext2GetBlockFunction · 0.85
Ext2MapIndirectFunction · 0.85

Calls 7

Ext2GetInodeLbaFunction · 0.85
Ext2AllocatePoolFunction · 0.85
Ext2LoadBufferFunction · 0.85
Ext2EncodeInodeFunction · 0.85
ext4_inode_csum_setFunction · 0.85
Ext2SaveBufferFunction · 0.85
Ext2StartFloppyFlushDpcFunction · 0.85

Tested by

no test coverage detected