lkml.org 
[lkml]   [2009]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] blktrace: swap arg name "from" and "to" of blk_add_trace_remap

* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

>
> Subject: [PATCH] blktrace: swap arg name "from" and "to" of blk_add_trace_remap
>
> Impact: cleanup for improve readability
>
> Currently, blk_add_trace_remap has following prototype.
>
> static void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
> dev_t dev, sector_t from, sector_t to)
>
> but caller pass "from" secter as 4th arg, "to" sector as 5th arg.
>
> example,
> --------------------------------------------------------
> static inline void blk_partition_remap(struct bio *bio)
> {
> struct block_device *bdev = bio->bi_bdev;
>
> if (bio_sectors(bio) && bdev != bdev->bd_contains) {
> struct hd_struct *p = bdev->bd_part;
>
> bio->bi_sector += p->start_sect;
> bio->bi_bdev = bdev->bd_contains;
>
> trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
> bdev->bd_dev, bio->bi_sector,
> bio->bi_sector - p->start_sect);
> }
> }
> --------------------------------------------------------
>
> Oh my god, it's reverse order.
> Fortunately, print logic reverse again. the twice reversing hide problem.

heh ... well spotted.

> but, but...
> It repeatedly confuse reviewer (include me!).
> Then, swapping argment name is better.

Agreed. Li, Jens, what do you think?

Ingo


\
 
 \ /
  Last update: 2009-04-30 08:51    [W:0.099 / U:14.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site