Allocate
(address: u32)
| 23 | { |
| 24 | // Allocate |
| 25 | pub fn alloc(address: u32) |
| 26 | { |
| 27 | let mut blk = Blk::read(BMapBlk::blkidx(address)); |
| 28 | let bmap = blk.datamut(); |
| 29 | let i = BMapBlk::buffidx(address); |
| 30 | |
| 31 | if !bmap[i / 8].get_bit(i % 8) |
| 32 | { |
| 33 | bmap[i / 8].set_bit(i % 8, true); |
| 34 | blk.write(); |
| 35 | crate::fs::sblk::alloc_count_up(); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // Block index |
| 40 | fn blkidx(address: u32) -> u32 |
nothing calls this directly
no test coverage detected