public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Andrew Morton <akpm@osdl.org>, Milan Broz <mbroz@redhat.com>,
	Heinz Mauelshagen <hjm@redhat.com>,
	linux-kernel@vger.kernel.org, dm-devel@redhat.com
Subject: Re: [PATCH 01/11] dm io: fix bi_max_vecs
Date: Thu, 23 Nov 2006 10:19:57 +0100	[thread overview]
Message-ID: <20061123091957.GM4999@kernel.dk> (raw)
In-Reply-To: <20061122185936.GR6993@agk.surrey.redhat.com>

On Wed, Nov 22 2006, Alasdair G Kergon wrote:
> From: Heinz Mauelshagen <hjm@redhat.com>
> 
> The existing code allocates an extra slot in bi_io_vec[] and uses it to
> store the region number.
> 
> This patch hides the extra slot from bio_add_page() so the region number
> can't get overwritten.
> 
> Also remove a hard-coded SECTOR_SHIFT and fix a typo in a comment.
>
> Index: linux-2.6.19-rc6/drivers/md/dm-io.c
> ===================================================================
> --- linux-2.6.19-rc6.orig/drivers/md/dm-io.c	2006-11-22 17:26:47.000000000 +0000
> +++ linux-2.6.19-rc6/drivers/md/dm-io.c	2006-11-22 17:26:53.000000000 +0000
> @@ -92,12 +92,12 @@ void dm_io_put(unsigned int num_pages)
>   *---------------------------------------------------------------*/
>  static inline void bio_set_region(struct bio *bio, unsigned region)
>  {
> -	bio->bi_io_vec[bio->bi_max_vecs - 1].bv_len = region;
> +	bio->bi_io_vec[bio->bi_max_vecs].bv_len = region;
>  }
>  

Ehm eww, that is really ugly code imo.

-- 
Jens Axboe


      reply	other threads:[~2006-11-23  9:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 18:59 [PATCH 01/11] dm io: fix bi_max_vecs Alasdair G Kergon
2006-11-23  9:19 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061123091957.GM4999@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@osdl.org \
    --cc=dm-devel@redhat.com \
    --cc=hjm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox