Returns an Error if the given offset doesn't align to a cluster boundary.
(offset: u64, cluster_bits: u32)
| 598 | |
| 599 | /// Returns an Error if the given offset doesn't align to a cluster boundary. |
| 600 | pub(super) fn offset_is_cluster_boundary(offset: u64, cluster_bits: u32) -> Result<()> { |
| 601 | if offset & ((0x01 << cluster_bits) - 1) != 0 { |
| 602 | return Err(Error::InvalidOffset(offset)); |
| 603 | } |
| 604 | Ok(()) |
| 605 | } |