Re: Question about dm target size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 11, 2014 at 07:37:44PM -0500, 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

Just make the size argument in your table be equal to dev_size / 2. This is
where ti->len comes from and it's the correct way to tell device-mapper how
big your mapped device should be.

Your ctr can then parse out /dev/whatever from its args, open it and do
whatever it likes with it. Access to that device by your target code is in
no way constrained by the offset/size params used in the table.

E.g.:

# dmsetup create pf0 --table="0 2048 power-fail /dev/whatever foo bar"

Would create a 1M device named pf0. The power-fail target could still access
the whole of /dev/whatever if it wants to.

within the 
Regards,
Bryn.

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux