[dm-devel] Re: [RFC][PATCH 2/4] dm-log: unify rw_header to read/write_header

Takahiro Yasui tyasui at redhat.com
Mon Dec 1 07:24:01 UTC 2008


Alasdair G Kergon wrote:
> On Tue, Nov 25, 2008 at 07:01:39PM -0500, Takahiro Yasui wrote:
>> rw_header function updates three members of io_req data every time
>> when I/O is processed. bi_rw and notify.fn are never modified once
>> they get initialized, and also they can be set in advance.
>> This patch removes unnecessary update operations.
>  
> Indeed.
> 
> And it also removes header_to_disk() from the disk_flush() code
> path but doesn't mention changing that:-)  I assume that's also
> OK because there'll always have been a resume before the flush
> and the data can only change during a resume?

Oh, I'm sorry not to mention it on the patch description, but
your explanation is exactly what I need to do.

>> +++ linux-2.6.28-rc4/drivers/md/dm-log.c
>> @@ -323,20 +323,13 @@ static void header_from_disk(struct log_
> 
>> -static int rw_header(struct log_c *lc, int rw)
> 
> I reckon that little function improves readability/maintainability and I've
> left it in.
> 
> http://www.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/
>     dm-log-avoid-reinitialising-io_req-on-every-operation.patch

Thanks, Alasdair. I have removed rw_header function in my patch
since the last two patches don't use it, but your improvement is
fine as a separate patch.

Thanks,
---
Takahiro Yasui
Hitachi Computer Products (America) Inc.




More information about the dm-devel mailing list