public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alasdair G Kergon <agk@redhat.com>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] device-mapper: multipath hardware handler for EMC
Date: Fri, 11 Feb 2005 19:58:41 +0000	[thread overview]
Message-ID: <20050211195841.GA13925@infradead.org> (raw)
In-Reply-To: <20050211172211.GA10195@agk.surrey.redhat.com>

> +/* Code borrowed from dm-lsi-rdac by Mike Christie */

Any reason that module isn't submitted?

> +	bio->bi_bdev = path->dev->bdev;
> +	bio->bi_sector = 0;
> +	bio->bi_private = path;
> +	bio->bi_end_io = emc_endio;
> +
> +	page = alloc_page(GFP_ATOMIC);
> +	if (!page) {
> +		DMERR("dm-emc: get_failover_bio: alloc_page() failed.");
> +		bio_put(bio);
> +		return NULL;
> +	}
> +
> +	if (bio_add_page(bio, page, data_size, 0) != data_size) {
> +		DMERR("dm-emc: get_failover_bio: alloc_page() failed.");
> +		__free_page(page);
> +		bio_put(bio);
> +		return NULL;
> +	}
> +
> +	return bio;

this would benefit from goto unwinding.

> +	if (h->short_trespass) {
> +		memcpy(page22, short_trespass_pg, data_size);
> +	} else {
> +		memcpy(page22, long_trespass_pg, data_size);
> +	}

	 memcpy(page22, h->short_trespass ?
	 	short_trespass_pg : long_trespass_pg, data_size);

?

> +static struct emc_handler *alloc_emc_handler(void)
> +{
> +	struct emc_handler *h = kmalloc(sizeof(*h), GFP_KERNEL);
> +
> +	if (h) {
> +		h->lock = SPIN_LOCK_UNLOCKED;
> +	}

	if (h)
		spin_lock_init(&h->lock);

> +static unsigned emc_err(struct hw_handler *hwh, struct bio *bio)
> +{
> +	/* FIXME: Patch from axboe still missing */

it's in -mm now afaik??

> +#if 0
> +	int sense;
> +
> +	if (bio->bi_error & BIO_SENSE) {
> +		sense = bio->bi_error & 0xffffff; /* sense key / asc / ascq */
> +
> +		if (sense == 0x020403) {

please use the sense handling helpers from Doug Gilbert so you can handle
the descriptor sense format aswell.  (And make the code a lot clear).

Also please try to use constants instead of magic numbers.


  reply	other threads:[~2005-02-11 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-11 17:22 [PATCH] device-mapper: multipath hardware handler for EMC Alasdair G Kergon
2005-02-11 19:58 ` Christoph Hellwig [this message]
2005-02-12  4:07   ` Lars Marowsky-Bree
2005-02-12 22:07   ` Mike Christie

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=20050211195841.GA13925@infradead.org \
    --to=hch@infradead.org \
    --cc=agk@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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