[dm-devel] device mapper target vs personality, how do you decide to pick one or the other?

Mike Snitzer snitzer at redhat.com
Sat Jul 12 00:36:20 UTC 2014


On Fri, Jul 11 2014 at  5:56pm -0400,
John Utz <John.Utz at wdc.com> wrote:

> Hi Mike
> 
> tnx so much for the prompt response! 
> 
> sorry i wasnt clear enuf, example of the 'personality code' that i was
> writing about below.
...
> FOR EXAMPLE, here is a little bit of linear.c that contains it:
> 
> static struct md_personality linear_personality =
> {
> 	.name		= "linear",
> 	.level		= LEVEL_LINEAR,
> 	.owner		= THIS_MODULE,
> 	.make_request	= linear_make_request,
> 	.run		= linear_run,
> 	.stop		= linear_stop,
> 	.status		= linear_status,
> 	.hot_add_disk	= linear_add,
> 	.size		= linear_size,
> };
> 
> static int __init linear_init (void)
> {
> 	return register_md_personality (&linear_personality);
> }
> 
> static void linear_exit (void)
> {
> 	unregister_md_personality (&linear_personality);
> }

The above is MD raid code.  So what you're talking about are the
different MD raid personalities.

> > so, based on this speculation, i *think* i should be using the target
> > construct for the new device mapper module that i am currently
> > coding.
> >
> > am i correct?
> 
> Probably.

The target construct is provided by DM.  You haven;t said what you're
looking to do but if it is remapping IO and has nothing to do with raid
then you'd probably want to develop a new DM target.




More information about the dm-devel mailing list