Re: [PATCH] bufio: fix the next_buf calculation

2018-04-18 Thread Daniel Kiper
On Wed, Apr 18, 2018 at 03:28:20PM +0800, Michael Chang wrote: > On Tue, Apr 17, 2018 at 07:11:34PM +0200, Daniel Kiper wrote: > > CC-ing Vladimir. > > > > On Mon, Apr 16, 2018 at 06:05:04PM +0800, Michael Chang wrote: > > > The next_buf is the offset to the next cached block rounded to the size

Re: [PATCH] bufio: fix the next_buf calculation

2018-04-18 Thread Michael Chang
On Tue, Apr 17, 2018 at 07:11:34PM +0200, Daniel Kiper wrote: > CC-ing Vladimir. > > On Mon, Apr 16, 2018 at 06:05:04PM +0800, Michael Chang wrote: > > The next_buf is the offset to the next cached block rounded to the size of > > bufio->block_size. However the calculation needs the block_size to

Re: [PATCH] bufio: fix the next_buf calculation

2018-04-17 Thread Daniel Kiper
CC-ing Vladimir. On Mon, Apr 16, 2018 at 06:05:04PM +0800, Michael Chang wrote: > The next_buf is the offset to the next cached block rounded to the size of > bufio->block_size. However the calculation needs the block_size to be in power > of 2 is not always valid. As an example, files with

[PATCH] bufio: fix the next_buf calculation

2018-04-16 Thread Michael Chang
The next_buf is the offset to the next cached block rounded to the size of bufio->block_size. However the calculation needs the block_size to be in power of 2 is not always valid. As an example, files with smaller size than block_size will have the block_size leveled to the size of file which can