Re: [PATCH 1/6] md: Make mddev->chunk_size sector-based.

From
Neil Brown <hidden>
Date
2009-05-25 23:02:20
On Monday May 25, maan@systemlinux.org wrote:
This patch changes the type of the chunk_size field from int to
sector_t and renames it to chunk_sectors with the implied change of
semantics. Since

	is_power_of_2(chunk_size) = is_power_of_2(chunk_sectors << 9)
				  = is_power_of_2(chunk_sectors)

these bits don't need an adjustment for the shift.
Thanks.

I don't really want chunk_sectors to be sector_t - it is a waste on
32bit, and would cause
+		if (sector_div(temp, mddev->chunk_sectors))
to fail.
I've left it as 'int' and removed all the (int) casts and (sector_t)
casts.   I adjusted the comment too.

I also changed:
	if (mddev->chunk_sectors << 9 < PAGE_SIZE ||
to
	if (mddev->chunk_sectors < (PAGE_SIZE >> 9) ||
primarily because I need the brackets around the shift, even if the
C compiler doesn't.


Thanks,
NeilBrown
Thread (1 message) 1 message, 1 author, last reply 2009-05-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help