Subject: Re: Work-around for certain buggy S-ATA PHYs
To: Christos Zoulas <christos@zoulas.com>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 03/21/2003 09:33:04
On Friday, March 21, 2003, at 09:15  AM, Christos Zoulas wrote:

> i would move the nbp out of the loop and do:
>
> 	struct *nbp = NULL;
>
> and then at the end do:
> 	if (__predict_false(nbp != NULL))
>
> instead of:
>
>        if (__predict_false((bp->b_flags & B_CALL) != 0 &&
>                            bp->b_iodone == wd_split_mod15_write))
>
> because I am not sure if the above test is adequate, since it does not
> match the exact condition of the first if statement (and anyway it is 
> cheaper).

The test for wd_split_mod15_write() is in wddone(), whereas the loop 
where nbp is used is in __wdstart().

Note that the only time b_iodone will be set to wd_split_mod15_write() 
is if the condition triggered, so it is, in fact, a pretty good way to 
determine what to do :-)

         -- Jason R. Thorpe <thorpej@wasabisystems.com>