| 673 | |
| 674 | |
| 675 | BOOLEAN |
| 676 | Ext2LoadBlock (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 | |
| 714 | BOOLEAN |
nothing calls this directly
no test coverage detected