Messages in this thread | | | Date | Fri, 23 Oct 2020 09:29:27 +0100 | From | Christoph Hellwig <> | Subject | Re: [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.
| |