All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <heinzm@redhat.com>
To: dm-devel@redhat.com
Subject: Re: Question about dm target size
Date: Wed, 12 Nov 2014 12:15:16 +0100	[thread overview]
Message-ID: <54634144.6080004@redhat.com> (raw)
In-Reply-To: <5462ABD8.1050609@fb.com>


On 11/12/2014 01:37 AM, Josef Bacik wrote:
> Hello,
>
> I'm creating a dm target to better test power fail situations and I'm 
> having trouble figuring out how to make the dm device appear as a 
> different size.  So for example you do the normal dm table
>
> offset size power-fail /dev/whatever args
>
> I want to use the entire size of /dev/whatever, but I want my dm 
> device to show up as size/2.  So right now I'm doing this in my ->ctr 
> function
>
> ti->len /= 2;

Passing in "ti->len = 'size of your dev in sectors' / 2" is what you want.

Heinz

>
> Is that acceptable, or will this have some side-effect that's going to 
> bite me in the ass?  I can't see any other target that does something 
> similar and there appears to be no helper function.  This seems to 
> work as far as blockdev --getsz is concerned, but I'm worried I need 
> to do more.  Thanks,
>
> Josef
>
> -- 
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

  parent reply	other threads:[~2014-11-12 11:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  0:37 Question about dm target size Josef Bacik
2014-11-12  2:06 ` Mike Snitzer
2014-11-12  2:30   ` Josef Bacik
2014-11-12  8:45     ` Zdenek Kabelac
2014-11-12 11:00       ` Josef Bacik
2014-11-12 11:48         ` Zdenek Kabelac
2014-11-12 11:15 ` Heinz Mauelshagen [this message]
2014-11-12 12:28 ` Bryn M. Reeves

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=54634144.6080004@redhat.com \
    --to=heinzm@redhat.com \
    --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 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.