lkml.org 
[lkml]   [2020]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] md: align superblock writes to physical blocks
> +	/* 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.

\
 
 \ /
  Last update: 2020-10-23 10:30    [W:6.849 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site