On Tue, Nov 21, 2017 at 04:06:54PM +0800, Qu Wenruo wrote:
> On 2017年11月21日 15:33, Nikolay Borisov wrote:
> > On 21.11.2017 07:54, Qu Wenruo wrote:
> >> @@ -2054,7 +2054,7 @@ static int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len,
> >> {
> >> int j, ret = 0;
> >> u64 bytes_left, end;
> >> - u64 aligned_start = ALIGN(start, 1 << 9);
> >> + u64 aligned_start = round_up(start, 1 << 9);
> >
> > nit: 1 << 9 == SZ_512 or essentially sector size however looking at the
> > defines there is SECTOR_SIZE defined in ide.h which we do not include.
> > Or just use 512 no need to obscure it behind a shift.
>
> I also noticed that while I don't have any good idea which macro should
> be used.
>
> That SECTOR_SIZE defined in ide.h doesn't sound good to me.
Heh, no we won't include ide.h just to get the macro definition.
> And all other filesystems are using their own definition, without some
> definition in fs/bio level.
That would be useful, as the sectorsize == 512 is part of the bio ABI.
I'd like to convert all the >> 9 shifts to *512 or /512, but this relies
on the compiler to convert namely the division to shifts where we use
u64.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html