Re: [PATCH 1/3] md: align superblock writes to physical blocks

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

 



> +	/* Respect physical block size if feasible. */
> +	bmask = queue_physical_block_size(rdev->bdev->bd_disk->queue)-1;
> +	if (!((rdev->sb_start * 512) & bmask) && (rdev->sb_size & bmask)) {
> +		int candidate_size = (rdev->sb_size | bmask) + 1;
> +
> +		if (minor_version) {
> +			int sectors = candidate_size / 512;
> +
> +			if (rdev->data_offset >= sb_start + sectors
> +			    && rdev->new_data_offset >= sb_start + sectors)

Linux coding style wants operators before the continuing line.

> +				rdev->sb_size = candidate_size;
> +		} else if (bmask <= 4095)
> +			rdev->sb_size = candidate_size;
> +	}

I also think this code would benefit from being factored into a helper.



[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