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

Function Ext2LoadBlock

Ext4Fsd/ext3/generic.c:675–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673
674
675BOOLEAN
676Ext2LoadBlock (IN PEXT2_VCB Vcb,
677 IN ULONG Index,
678 IN PVOID Buffer )
679{
680 struct buffer_head *bh = NULL;
681 BOOLEAN rc = 0;
682
683 __try {
684
685 bh = sb_getblk(&Vcb->sb, (sector_t)Index);
686
687 if (!bh) {
688 DEBUG(DL_ERR, ("Ext2Loadblock: can't load block %u\n", Index));
689 DbgBreak();
690 __leave;
691 }
692
693 if (!buffer_uptodate(bh)) {
694 int err = bh_submit_read(bh);
695 if (err < 0) {
696 DEBUG(DL_ERR, ("Ext2LoadBlock: reading failed %d\n", err));
697 __leave;
698 }
699 }
700
701 RtlCopyMemory(Buffer, bh->b_data, BLOCK_SIZE);
702 rc = TRUE;
703
704 } __finally {
705
706 if (bh)
707 fini_bh(&bh);
708 }
709
710 return rc;
711}
712
713
714BOOLEAN

Callers

nothing calls this directly

Calls 3

sb_getblkFunction · 0.85
bh_submit_readFunction · 0.85
fini_bhFunction · 0.85

Tested by

no test coverage detected