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

[dm-devel] puzzled by the usage of dm_get_device(.....)



Hi There

I am developing a device-mapper plugin as part of an assignment. Reading through dm-crypt, dm-snapshot and various other i see this construct

static int <name>_ctr(struct dm_target *ti, unsigned int argc, char ** argv)
{


.....

	if(dm_get_device(ti, ..., ..., ti->len, ..) {
		// ERROR
	}
	ti->private = ....
	return 0;
}

My question now is, why do ppl pass ti->len onto dm_get_device. ti->len is not set by the plugins and could be very wrong (is in my case anyhow)? And what part of the code actually sets the value of ti->len before the ctr routine is called.

My module bails out at sectors over 14MB, but thats because ti->len is around 28000 when dm_get_device is called. But thats just play wrong, my partition is much bigger than that.

Could someone enlighten me, please :-)

Regards Thomas, Denmark.


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