From: Mike Christie <michaelc@cs.wisc.edu>
To: sekharan@us.ibm.com
Cc: Mike Anderson <andmike@us.ibm.com>,
dm-devel <dm-devel@redhat.com>,
Alasdair G Kergon <agk@redhat.com>
Subject: Re: dm-multipath based engenio-lsi hardware handler
Date: Thu, 22 Mar 2007 13:04:35 -0500 [thread overview]
Message-ID: <4602C533.3010908@cs.wisc.edu> (raw)
In-Reply-To: <1174589692.22545.33.camel@linuxchandra>
Chandra Seetharaman wrote:
Did you see may later revisions on this or Ed's updated handler? In the
current kernel we do not need to allocate or manage our own bios. That
was a old old hack from when the request did not have a end io. The hack
is probably only needed for old distros. It is not needed upstream.
For dm based hw handlers you want to do something more like this:
http://www.cs.wisc.edu/~michaelc/block/dm/v4/
> static struct bio *get_rdac_bio(struct path *path, unsigned data_size,
> bio_end_io_t endio, int rw, struct rdac_handler *h)
> {
> struct bio *bio;
> struct page *page;
> struct rdac_private *p;
>
> bio = bio_alloc(GFP_ATOMIC, 1);
> if (!bio)
> return NULL;
>
> if (rw == WRITE)
> bio->bi_rw |= (1 << BIO_RW);
> bio->bi_bdev = path->dev->bdev;
> bio->bi_sector = 0;
> bio->bi_end_io = endio;
>
> p = kmalloc(sizeof(*p), GFP_ATOMIC);
> if (!p)
> goto bio;
>
> p->path = path;
> p->h = h;
> bio->bi_private = p;
> page = alloc_page(GFP_ATOMIC);
> if (!page)
> goto free_private;
>
> if (bio_add_page(bio, page, data_size, 0) == data_size)
> return bio;
>
> __free_page(page);
> free_private:
> kfree(p);
> bio:
> bio_put(bio);
> return NULL;
> }
>
> static void rdac_pg_init(struct hw_handler *hwh, unsigned bypassed,
> struct path *path)
> {
> struct rdac_handler *h = hwh->context;
>
> switch (h->lun) {
> case UNINITIALIZED_LUN:
> submit_c8_inquiry(h, path);
> break;
> case UNSUPPORTED_LUN:
> dm_pg_init_complete(path, MP_FAIL_PATH);
> break;
> default:
> submit_c9_inquiry(h, path);
> }
> }
>
Why not just have userspace check and pass the LUN to the create
function? This is not a review comment to do it. I am just asking if it
is difficult to gather info in userspace and pass it down?
next parent reply other threads:[~2007-03-22 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1174589692.22545.33.camel@linuxchandra>
2007-03-22 18:04 ` Mike Christie [this message]
2007-03-22 23:37 ` dm-multipath based engenio-lsi hardware handler Chandra Seetharaman
2007-03-27 17:20 ` Mike Christie
2007-03-21 19:23 Chandra Seetharaman
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=4602C533.3010908@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=agk@redhat.com \
--cc=andmike@us.ibm.com \
--cc=dm-devel@redhat.com \
--cc=sekharan@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.