@@ -11,8 +11,7 @@ use nix::libc::c_ulong;
1111use nix:: libc:: ioctl as nix_ioctl;
1212
1313use crate :: core:: {
14- DevId , Device , DeviceInfo , DmFlags , DmName , DmNameBuf , DmOptions , DmUuid , Sectors ,
15- TargetTypeBuf ,
14+ DevId , Device , DeviceInfo , DmFlags , DmName , DmNameBuf , DmOptions , DmUuid , TargetTypeBuf ,
1615} ;
1716use crate :: result:: { DmError , DmResult } ;
1817
@@ -401,7 +400,7 @@ impl DM {
401400 & self ,
402401 id : & DevId ,
403402 options : & DmOptions ,
404- ) -> DmResult < ( DeviceInfo , Vec < ( Sectors , Sectors , TargetTypeBuf , String ) > ) > {
403+ ) -> DmResult < ( DeviceInfo , Vec < ( u64 , u64 , TargetTypeBuf , String ) > ) > {
405404 let mut hdr = options. to_ioctl_hdr ( Some ( id) , DmFlags :: DM_QUERY_INACTIVE_TABLE ) ;
406405
407406 let data_out = self . do_ioctl ( dmi:: DM_DEV_WAIT_CMD as u8 , & mut hdr, None ) ?;
@@ -423,14 +422,14 @@ impl DM {
423422 /// # Example
424423 ///
425424 /// ```no_run
426- /// use devicemapper::{DM, DevId, DmName, Sectors, TargetTypeBuf};
425+ /// use devicemapper::{DM, DevId, DmName, TargetTypeBuf};
427426 /// let dm = DM::new().unwrap();
428427 ///
429428 /// // Create a 16MiB device (32768 512-byte sectors) that maps to /dev/sdb1
430429 /// // starting 1MiB into sdb1
431430 /// let table = vec![(
432- /// Sectors(0) ,
433- /// Sectors( 32768) ,
431+ /// 0 ,
432+ /// 32768,
434433 /// TargetTypeBuf::new("linear".into()).expect("valid"),
435434 /// "/dev/sdb1 2048".into()
436435 /// )];
@@ -442,16 +441,16 @@ impl DM {
442441 pub fn table_load (
443442 & self ,
444443 id : & DevId ,
445- targets : & [ ( Sectors , Sectors , TargetTypeBuf , String ) ] ,
444+ targets : & [ ( u64 , u64 , TargetTypeBuf , String ) ] ,
446445 ) -> DmResult < DeviceInfo > {
447446 let mut targs = Vec :: new ( ) ;
448447
449448 // Construct targets first, since we need to know how many & size
450449 // before initializing the header.
451450 for t in targets {
452451 let mut targ: dmi:: Struct_dm_target_spec = Default :: default ( ) ;
453- targ. sector_start = * t. 0 ;
454- targ. length = * t. 1 ;
452+ targ. sector_start = t. 0 ;
453+ targ. length = t. 1 ;
455454 targ. status = 0 ;
456455
457456 let dst: & mut [ u8 ] = unsafe { & mut * ( & mut targ. target_type [ ..] as * mut [ u8 ] ) } ;
@@ -554,10 +553,7 @@ impl DM {
554553 // will either be backwards-compatible, or will increment
555554 // DM_VERSION_MAJOR. Since calls made with a non-matching major version
556555 // will fail, this protects against callers parsing unknown formats.
557- fn parse_table_status (
558- count : u32 ,
559- buf : & [ u8 ] ,
560- ) -> Vec < ( Sectors , Sectors , TargetTypeBuf , String ) > {
556+ fn parse_table_status ( count : u32 , buf : & [ u8 ] ) -> Vec < ( u64 , u64 , TargetTypeBuf , String ) > {
561557 let mut targets = Vec :: new ( ) ;
562558 if !buf. is_empty ( ) {
563559 let mut next_off = 0 ;
@@ -584,8 +580,8 @@ impl DM {
584580 } ;
585581
586582 targets. push ( (
587- Sectors ( targ. sector_start ) ,
588- Sectors ( targ. length ) ,
583+ targ. sector_start ,
584+ targ. length ,
589585 TargetTypeBuf :: new ( target_type) . expect ( "< sizeof target_spec" ) ,
590586 params,
591587 ) ) ;
@@ -629,7 +625,7 @@ impl DM {
629625 & self ,
630626 id : & DevId ,
631627 options : & DmOptions ,
632- ) -> DmResult < ( DeviceInfo , Vec < ( Sectors , Sectors , TargetTypeBuf , String ) > ) > {
628+ ) -> DmResult < ( DeviceInfo , Vec < ( u64 , u64 , TargetTypeBuf , String ) > ) > {
633629 let mut hdr = options. to_ioctl_hdr (
634630 Some ( id) ,
635631 DmFlags :: DM_NOFLUSH | DmFlags :: DM_STATUS_TABLE | DmFlags :: DM_QUERY_INACTIVE_TABLE ,
@@ -683,13 +679,13 @@ impl DM {
683679 pub fn target_msg (
684680 & self ,
685681 id : & DevId ,
686- sector : Option < Sectors > ,
682+ sector : Option < u64 > ,
687683 msg : & str ,
688684 ) -> DmResult < ( DeviceInfo , Option < String > ) > {
689685 let mut hdr = DmOptions :: new ( ) . to_ioctl_hdr ( Some ( id) , DmFlags :: empty ( ) ) ;
690686
691687 let mut msg_struct: dmi:: Struct_dm_target_msg = Default :: default ( ) ;
692- msg_struct. sector = * sector. unwrap_or_default ( ) ;
688+ msg_struct. sector = sector. unwrap_or_default ( ) ;
693689 let mut data_in = unsafe {
694690 let ptr = & msg_struct as * const dmi:: Struct_dm_target_msg as * mut u8 ;
695691 slice:: from_raw_parts ( ptr, size_of :: < dmi:: Struct_dm_target_msg > ( ) ) . to_vec ( )
0 commit comments