From: Mike Snitzer <snitzer@redhat.com>
To: Eric Wheeler <dm-devel@lists.ewheeler.net>
Cc: dm-devel@redhat.com
Subject: Re: How can I get my sector size (via queue_limits?) from a dm_target?
Date: Wed, 20 Jan 2016 12:52:23 -0500 [thread overview]
Message-ID: <20160120175222.GA15897@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.11.1601191922570.22808@mail.ewheeler.net>
On Tue, Jan 19 2016 at 10:32pm -0500,
Eric Wheeler <dm-devel@lists.ewheeler.net> wrote:
> Hello all,
>
> dm_target->len gives me sector count, but I need to know the default
> sector size discovered by the blk stacking code without assuming 512b.
>
> Now that I have the dm .iterate_devices callback defined and my
> queue_limits are sane by default, how can I get a pointer to the
> queue_limits structure for my device given a dm_target structure?
>
> It looks like I should call dm_get_md_queue() after getting the md from
> dm_table_get_md(target->table), but dm_get_md_queue is not an exported
> symbol.
>
> Also, is that value correct within the .ctr, or only after the .ctr
> returns? If after, how can I hook in after limits are assigned but before
> .map gets called? Otherwise stated, I would like to know the stacked
> queue_limits corrected for lower layers within the .ctr function.
You cannot know it from .ctr because the device is actively being
constructed. The .io_hints hook allows you access to stacked
queue_limits -- see dm_calculate_queue_limits() which calls ->io_hints
_after_ combining all underlying queue_limits.
See dm-thin.c's pool_io_hints() and thin_io_hints() for examples of how
the .io_hints hook is used for DM-thinp.
Mike
prev parent reply other threads:[~2016-01-20 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 3:32 How can I get my sector size (via queue_limits?) from a dm_target? Eric Wheeler
2016-01-20 17:52 ` Mike Snitzer [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=20160120175222.GA15897@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@lists.ewheeler.net \
--cc=dm-devel@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