Re: [PATCH 1/3] btrfs: Introduce macros to handle bytes and sector conversion

2017-11-24 Thread David Sterba
On Fri, Nov 24, 2017 at 08:53:09AM +0200, Nikolay Borisov wrote: > On 24.11.2017 06:10, Qu Wenruo wrote: > > Since block I/O is always done in unit of 512 bytes, add BI_SECTOR_SIZE > > and BI_SECTOR_SHIFT macros and to_sector() and to_bytes() for later > > use. > > > > Although the best position

Re: [PATCH 1/3] btrfs: Introduce macros to handle bytes and sector conversion

2017-11-23 Thread Qu Wenruo
On 2017年11月24日 14:53, Nikolay Borisov wrote: > > > On 24.11.2017 06:10, Qu Wenruo wrote: >> Since block I/O is always done in unit of 512 bytes, add BI_SECTOR_SIZE >> and BI_SECTOR_SHIFT macros and to_sector() and to_bytes() for later >> use. >> >> Although the best position to define such

Re: [PATCH 1/3] btrfs: Introduce macros to handle bytes and sector conversion

2017-11-23 Thread Nikolay Borisov
On 24.11.2017 06:10, Qu Wenruo wrote: > Since block I/O is always done in unit of 512 bytes, add BI_SECTOR_SIZE > and BI_SECTOR_SHIFT macros and to_sector() and to_bytes() for later > use. > > Although the best position to define such things should be bvec.h, and > to_sector() to_bytes() are

[PATCH 1/3] btrfs: Introduce macros to handle bytes and sector conversion

2017-11-23 Thread Qu Wenruo
Since block I/O is always done in unit of 512 bytes, add BI_SECTOR_SIZE and BI_SECTOR_SHIFT macros and to_sector() and to_bytes() for later use. Although the best position to define such things should be bvec.h, and to_sector() to_bytes() are also defined in device-mapper.h, there are a lot of