@@ -9,7 +9,7 @@ pub use summary::Summary;
99pub use Reflection as HardlinkListReflection ;
1010pub use Summary as SharedLinkSummary ;
1111
12- use crate :: { device_number :: DeviceNumber , hardlink:: LinkPathList , inode:: InodeNumber , size} ;
12+ use crate :: { device :: DeviceNumber , hardlink:: LinkPathList , inode:: InodeNumber , size} ;
1313use dashmap:: DashMap ;
1414use derive_more:: { Display , Error } ;
1515use smart_default:: SmartDefault ;
@@ -78,31 +78,27 @@ impl<Size> HardlinkList<Size> {
7878 }
7979}
8080
81- /// Error that occurs when a different size was detected for the same [`ino`][ino].
82- ///
83- /// <!-- Should have been `std::os::unix::fs::MetadataExt::ino` but it would error on Windows -->
84- /// [ino]: https://doc.rust-lang.org/std/os/unix/fs/trait.MetadataExt.html#tymethod.ino
81+ /// Error that occurs when a different size was detected for the same inode.
8582#[ derive( Debug , Display , Error ) ]
8683#[ cfg_attr( test, derive( PartialEq , Eq ) ) ]
8784#[ display( bound( Size : Debug ) ) ]
88- #[ display( "Size for inode {ino} changed from {recorded:?} to {detected:?}" ) ]
85+ #[ display( "Size for inode {ino} on device {dev} changed from {recorded:?} to {detected:?}" ) ]
8986pub struct SizeConflictError < Size > {
9087 pub ino : InodeNumber ,
88+ pub dev : DeviceNumber ,
9189 pub recorded : Size ,
9290 pub detected : Size ,
9391}
9492
95- /// Error that occurs when a different [`nlink`][nlink] was detected for the same [`ino`][ino].
96- ///
97- /// <!-- Should have been `std::os::unix::fs::MetadataExt::nlink` but it would error on Windows -->
98- /// [nlink]: https://doc.rust-lang.org/std/os/unix/fs/trait.MetadataExt.html#tymethod.nlink
99- /// <!-- Should have been `std::os::unix::fs::MetadataExt::ino` but it would error on Windows -->
100- /// [ino]: https://doc.rust-lang.org/std/os/unix/fs/trait.MetadataExt.html#tymethod.ino
93+ /// Error that occurs when a different number of links was detected for the same inode.
10194#[ derive( Debug , Display , Error ) ]
10295#[ cfg_attr( test, derive( PartialEq , Eq ) ) ]
103- #[ display( "Number of links of inode {ino} changed from {recorded:?} to {detected:?}" ) ]
96+ #[ display(
97+ "Number of links of inode {ino} on device {dev} changed from {recorded:?} to {detected:?}"
98+ ) ]
10499pub struct NumberOfLinksConflictError {
105100 pub ino : InodeNumber ,
101+ pub dev : DeviceNumber ,
106102 pub recorded : u64 ,
107103 pub detected : u64 ,
108104}
@@ -139,6 +135,7 @@ where
139135 if size != recorded. size {
140136 assertions = Err ( AddError :: SizeConflict ( SizeConflictError {
141137 ino,
138+ dev,
142139 recorded : recorded. size ,
143140 detected : size,
144141 } ) ) ;
@@ -149,6 +146,7 @@ where
149146 assertions = Err ( AddError :: NumberOfLinksConflict (
150147 NumberOfLinksConflictError {
151148 ino,
149+ dev,
152150 recorded : recorded. links ,
153151 detected : links,
154152 } ,
0 commit comments