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:
Zach Brown
2017-01-20 13:52:46 -08:00
parent 736d5765fc
commit 685eb1f2dc
+1 -1
View File
@@ -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]);