Re: [PATCH 3/3] raid1: Rewrite the implementation of iobarrier.

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

 



On Mon, 19 Aug 2013 19:58:07 +0800 majianpeng <majianpeng@xxxxxxxxx> wrote:

> @@ -846,10 +859,57 @@ static void lower_barrier(struct r1conf *conf)
>  	wake_up(&conf->wait_barrier);
>  }
>  
> -static void wait_barrier(struct r1conf *conf)
> +static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
>  {
> +	sector_t sector = 0;
>  	spin_lock_irq(&conf->resync_lock);
> -	if (conf->barrier) {
> +	if (conf->barrier || unlikely(conf->freeze_array)) {
> +		if (unlikely(!conf->freeze_array && bio) &&

I forgot to mention this bit.
If we need to test freeze_array here, then maybe that test should have been
added in the previous patch which introduced "freeze_array"?

And I think the field should be "array_frozen".  "freeze_array" sounds like
an action so it is a suitable name for a function, but not for a variable.

Also I think you probably mean "likely" rather than "unlikely" the second
time???
I rather avoid "likely" and "unlikely" calls unless they will really
make an important difference.


NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux