Re: [PATCH 3/4] block: Add and use a rw_stat_group function for indexing partition stat fields.

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

 



Michael Callahan <michaelcallahan@xxxxxx> writes:

Sorry for the segmented review.

> diff --git a/block/bio.c b/block/bio.c
> index 807d25e..91b082d 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1678,27 +1678,29 @@ void bio_check_pages_dirty(struct bio *bio)
>  	}
>  }
>  
> -void generic_start_io_acct(int rw, unsigned long sectors,
> +void generic_start_io_acct(int sgrp, unsigned long sectors,
>  			   struct hd_struct *part)
>  {
> +	const int rw = stat_group_to_rw(sgrp);
>  	int cpu = part_stat_lock();
>  
>  	part_round_stats(cpu, part);
> -	part_stat_inc(cpu, part, ios[rw]);
> -	part_stat_add(cpu, part, sectors[rw], sectors);
> +	part_stat_inc(cpu, part, ios[sgrp]);
> +	part_stat_add(cpu, part, sectors[sgrp], sectors);
>  	part_inc_in_flight(part, rw);
>  
>  	part_stat_unlock();
>  }
>  EXPORT_SYMBOL(generic_start_io_acct);
>  
> -void generic_end_io_acct(int rw, struct hd_struct *part,
> +void generic_end_io_acct(int sgrp, struct hd_struct *part,
>  			 unsigned long start_time)
>  {
>  	unsigned long duration = jiffies - start_time;
> +	const int rw = stat_group_to_rw(sgrp);

You modified these functions to take a stat group, then changed all
callers to turn an rw_flag into a stat group, and then turn right around
and convert that back into rw as the first order of business.  Why can't
you do the conversion in generic_start/end_io_acct from rw to stat
group?

Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux