Re: Question about dm target size

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

 




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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

--
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