<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thanks<BR>We are trying to create this module without modifying existing kernel code,<BR>so that it will be easy to install it in existing environements.<BR>using a name like dm-1 is not user freindly , since the user needs to go and figure out<BR>this name before procceding.<BR>I see that there's a method <a href="http://lxr.free-electrons.com/ident?i=dm_copy_name_and_uuid">dm_copy_name_and_uuid</a> , but its not extern.<BR>I guess I'll just let the user set the name for now.<BR> <BR>Thanks<BR>-gili<br> <BR><div>> Date: Mon, 6 Jul 2015 12:49:56 +0300<br>> From: n.borisov@siteground.com<br>> To: dm-devel@redhat.com<br>> Subject: Re: [dm-devel] Getting mapped device namw<br>> <br>> <br>> <br>> On 07/06/2015 12:40 PM, Gili B wrote:<br>> > Thanks<br>> > hash_cell is defined privately in dm_ioctl.c , so I cannot access it.<br>> The beauty of open source software is that you can always export it for<br>> you own needs :)<br>> <br>> > also dm_get_mdptr ,is not extern so I can't access it neither.<br>> The function is exposed via device_mapper.h so you can just include this<br>> header. Poke the code around you might come up with an even better idea.<br>> But generally you wouldn't want to use the name the user provided.<br>> Instead, use the name of the block device being created e.g. dm-1. This<br>> can be obtained from the  dm_get_device function and using the dm_dev struct<br>> <br>> >  <br>> > Thanks<br>> > -gili<br>> >  <br>> >> Date: Mon, 6 Jul 2015 12:32:33 +0300<br>> >> From: kernel@kyup.com<br>> >> To: dm-devel@redhat.com<br>> >> Subject: Re: [dm-devel] Getting mapped device namw<br>> >><br>> >><br>> >> On 07/06/2015 12:20 PM, Gili B wrote:<br>> >>> hi<br>> >>> when a user run :<br>> >>> dmsetup create [device name] ....<br>> >>> Can a device mapper target find out the device name that the user entered ?<br>> >><br>> >> Apparently the name is being associated with a hash_cell object, which<br>> >> in turn is associated with struct mapped_device in dm_hash_insert<br>> >> (called from dev_create, which is invoked as part of the create IOCTL).<br>> >> So presumably if you get an instance of struct mapped_device and then<br>> >> invoke dm_get_mdptr(md). What you'd get is a pointer to struct hash_cell<br>> >><br>> >>> I need it for creating entries in proc for example.<br>> >>>  <br>> >>> Thanks<br>> >>> -gili<br>> >>>                                          <br>> >>><br>> >>><br>> >>><br>> >>> --<br>> >>> dm-devel mailing list<br>> >>> dm-devel@redhat.com<br>> >>> https://www.redhat.com/mailman/listinfo/dm-devel<br>> >>><br>> >><br>> >> --<br>> >> dm-devel mailing list<br>> >> dm-devel@redhat.com<br>> >> https://www.redhat.com/mailman/listinfo/dm-devel<br>> >                                      <br>> > <br>> > <br>> > <br>> > --<br>> > dm-devel mailing list<br>> > dm-devel@redhat.com<br>> > https://www.redhat.com/mailman/listinfo/dm-devel<br>> > <br>> <br>> --<br>> dm-devel mailing list<br>> dm-devel@redhat.com<br>> https://www.redhat.com/mailman/listinfo/dm-devel<br></div>                                           </div></body>
</html>