diff options
Diffstat (limited to 'gbl/libgbl/src/fastboot')
-rw-r--r-- | gbl/libgbl/src/fastboot/mod.rs | 2 | ||||
-rw-r--r-- | gbl/libgbl/src/fastboot/vars.rs | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gbl/libgbl/src/fastboot/mod.rs b/gbl/libgbl/src/fastboot/mod.rs index dcdb081..06057e8 100644 --- a/gbl/libgbl/src/fastboot/mod.rs +++ b/gbl/libgbl/src/fastboot/mod.rs @@ -141,7 +141,7 @@ impl<'a> GblFastboot<'a> { let (blk_id, max_size) = match part { "" => { let blk_id = blk_id.ok_or("Must provide a block device ID")?; - (blk_id, devs.get(blk_id)?.total_size()?) + (blk_id, devs.get(blk_id)?.info().total_size()?) } gpt => match blk_id { Some(id) => (id, devs.get(id)?.find_partition(gpt)?.size()?), diff --git a/gbl/libgbl/src/fastboot/vars.rs b/gbl/libgbl/src/fastboot/vars.rs index 521205a..d1b08fa 100644 --- a/gbl/libgbl/src/fastboot/vars.rs +++ b/gbl/libgbl/src/fastboot/vars.rs @@ -140,8 +140,8 @@ impl Variable for BlockDevice { let id = next_arg_u64(&mut args, Err("Missing block device ID".into()))?; let val_type = next_arg(&mut args, Err("Missing value type".into()))?; let val = match val_type { - TOTAL_BLOCKS => gbl_fb.storage().get(id)?.num_blocks()?, - BLOCK_SIZE => gbl_fb.storage().get(id)?.block_size()?, + TOTAL_BLOCKS => gbl_fb.storage().get(id)?.info().num_blocks, + BLOCK_SIZE => gbl_fb.storage().get(id)?.info().block_size, _ => return Err("Invalid type".into()), }; Some(snprintf!(out, "{:#x}", val).len()) @@ -161,8 +161,12 @@ impl Variable for BlockDevice { let mut id_str = [0u8; 32]; let id = snprintf!(id_str, "{:x}", id); res = (|| { - f(BLOCK_DEVICE, &[id, "total-blocks"], snprintf!(val, "{:#x}", blk.num_blocks()?))?; - f(BLOCK_DEVICE, &[id, "block-size"], snprintf!(val, "{:#x}", blk.block_size()?)) + f( + BLOCK_DEVICE, + &[id, "total-blocks"], + snprintf!(val, "{:#x}", blk.info().num_blocks), + )?; + f(BLOCK_DEVICE, &[id, "block-size"], snprintf!(val, "{:#x}", blk.info().block_size)) })(); res.is_err() })?; |