[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [PATCH 2/2] Use low pointer bits for dm io region



Hi Mikulas,

On 11/11/2009 11:05 AM +0900, Mikulas Patocka wrote:
> Use low pointer bits for dm io region
> 
> We need to store two things per bio: the pointer to the main io structure and
> a region number, an index of disk where this bio belongs to (if there is
> simultaneous write to multiple disks). There can be at most BITS_PER_LONG
> regions. BITS_PER_LONG is 32 on 32-bit machines and 64 on 64-bit machines.
> 
> A region number was stored in the last hidden bio vector and the pointer to
> struct io was stored in bi_private.
> 
> This patch changes it so that "struct io" is always aligned on BITS_PER_LONG
> bytes and region number is stored in the low BITS_PER_LONG bits of bi_private.

The code is not easily readable for me.
Why don't you introduce a new structure in which those two things
can be stored, and allocate/attach it per bio?
If it's possible, the code should be easy to read and maintain, I think.

Thanks,
Kiyoshi Ueda


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]