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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday May 25, maan@xxxxxxxxxxxxxxx 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
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux