mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-19 22:42:40 +00:00
Fix segment block item alignemnt build bug
The BUILD_BUG_ON() to test that the start of the items in the segment header is naturally aligned had a typo that masked the length instead of checking the remainder of division by the length. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+1
-1
@@ -383,7 +383,7 @@ static u32 pos_off(u32 pos)
|
||||
/* items need of be a power of two */
|
||||
BUILD_BUG_ON(!is_power_of_2(sizeof(struct scoutfs_segment_item)));
|
||||
/* and the first item has to be naturally aligned */
|
||||
BUILD_BUG_ON(offsetof(struct scoutfs_segment_block, items) &
|
||||
BUILD_BUG_ON(offsetof(struct scoutfs_segment_block, items) %
|
||||
sizeof(struct scoutfs_segment_item));
|
||||
|
||||
return offsetof(struct scoutfs_segment_block, items[pos]);
|
||||
|
||||
Reference in New Issue
Block a user