All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting mapped device namw
@ 2015-07-06  9:20 Gili B
  2015-07-06  9:32 ` Nikolay Borisov
  2015-07-06 11:20 ` Zdenek Kabelac
  0 siblings, 2 replies; 10+ messages in thread
From: Gili B @ 2015-07-06  9:20 UTC (permalink / raw)
  To: dm-devel@redhat.com


[-- Attachment #1.1: Type: text/plain, Size: 218 bytes --]

hi
when a user run :
dmsetup create [device name] ....
Can a device mapper target find out the device name that the user entered ?
I need it for creating entries in proc for example.
 
Thanks
-gili
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 456 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06  9:20 Getting mapped device namw Gili B
@ 2015-07-06  9:32 ` Nikolay Borisov
  2015-07-06  9:40   ` Gili B
  2015-07-06 11:20 ` Zdenek Kabelac
  1 sibling, 1 reply; 10+ messages in thread
From: Nikolay Borisov @ 2015-07-06  9:32 UTC (permalink / raw)
  To: device-mapper development


On 07/06/2015 12:20 PM, Gili B wrote:
> hi
> when a user run :
> dmsetup create [device name] ....
> Can a device mapper target find out the device name that the user entered ?

Apparently the name is being associated with a hash_cell object, which
in turn is associated with struct mapped_device in dm_hash_insert
(called from dev_create, which is invoked as part of the create IOCTL).
So presumably if you get an instance of struct mapped_device and then
invoke dm_get_mdptr(md). What you'd get is a pointer to struct hash_cell

> I need it for creating entries in proc for example.
>  
> Thanks
> -gili
>  		 	   		  
> 
> 
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06  9:32 ` Nikolay Borisov
@ 2015-07-06  9:40   ` Gili B
  2015-07-06  9:49     ` Nikolay Borisov
  0 siblings, 1 reply; 10+ messages in thread
From: Gili B @ 2015-07-06  9:40 UTC (permalink / raw)
  To: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 1250 bytes --]

Thanks
hash_cell is defined privately in dm_ioctl.c , so I cannot access it.
also dm_get_mdptr ,is not extern so I can't access it neither.
 
Thanks
-gili
 
> Date: Mon, 6 Jul 2015 12:32:33 +0300
> From: kernel@kyup.com
> To: dm-devel@redhat.com
> Subject: Re: [dm-devel] Getting mapped device namw
> 
> 
> On 07/06/2015 12:20 PM, Gili B wrote:
> > hi
> > when a user run :
> > dmsetup create [device name] ....
> > Can a device mapper target find out the device name that the user entered ?
> 
> Apparently the name is being associated with a hash_cell object, which
> in turn is associated with struct mapped_device in dm_hash_insert
> (called from dev_create, which is invoked as part of the create IOCTL).
> So presumably if you get an instance of struct mapped_device and then
> invoke dm_get_mdptr(md). What you'd get is a pointer to struct hash_cell
> 
> > I need it for creating entries in proc for example.
> >  
> > Thanks
> > -gili
> >  		 	   		  
> > 
> > 
> > 
> > --
> > dm-devel mailing list
> > dm-devel@redhat.com
> > https://www.redhat.com/mailman/listinfo/dm-devel
> > 
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1743 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06  9:40   ` Gili B
@ 2015-07-06  9:49     ` Nikolay Borisov
  2015-07-08  5:56       ` Gili B
  0 siblings, 1 reply; 10+ messages in thread
From: Nikolay Borisov @ 2015-07-06  9:49 UTC (permalink / raw)
  To: device-mapper development



On 07/06/2015 12:40 PM, Gili B wrote:
> Thanks
> hash_cell is defined privately in dm_ioctl.c , so I cannot access it.
The beauty of open source software is that you can always export it for
you own needs :)

> also dm_get_mdptr ,is not extern so I can't access it neither.
The function is exposed via device_mapper.h so you can just include this
header. Poke the code around you might come up with an even better idea.
But generally you wouldn't want to use the name the user provided.
Instead, use the name of the block device being created e.g. dm-1. This
can be obtained from the  dm_get_device function and using the dm_dev struct

>  
> Thanks
> -gili
>  
>> Date: Mon, 6 Jul 2015 12:32:33 +0300
>> From: kernel@kyup.com
>> To: dm-devel@redhat.com
>> Subject: Re: [dm-devel] Getting mapped device namw
>>
>>
>> On 07/06/2015 12:20 PM, Gili B wrote:
>>> hi
>>> when a user run :
>>> dmsetup create [device name] ....
>>> Can a device mapper target find out the device name that the user entered ?
>>
>> Apparently the name is being associated with a hash_cell object, which
>> in turn is associated with struct mapped_device in dm_hash_insert
>> (called from dev_create, which is invoked as part of the create IOCTL).
>> So presumably if you get an instance of struct mapped_device and then
>> invoke dm_get_mdptr(md). What you'd get is a pointer to struct hash_cell
>>
>>> I need it for creating entries in proc for example.
>>>  
>>> Thanks
>>> -gili
>>>  		 	   		  
>>>
>>>
>>>
>>> --
>>> dm-devel mailing list
>>> dm-devel@redhat.com
>>> https://www.redhat.com/mailman/listinfo/dm-devel
>>>
>>
>> --
>> dm-devel mailing list
>> dm-devel@redhat.com
>> https://www.redhat.com/mailman/listinfo/dm-devel
>  		 	   		  
> 
> 
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06  9:20 Getting mapped device namw Gili B
  2015-07-06  9:32 ` Nikolay Borisov
@ 2015-07-06 11:20 ` Zdenek Kabelac
  2015-07-06 12:04   ` Gili B
  1 sibling, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2015-07-06 11:20 UTC (permalink / raw)
  To: device-mapper development

Dne 6.7.2015 v 11:20 Gili B napsal(a):
> hi
> when a user run :
> dmsetup create [device name] ....
> Can a device mapper target find out the device name that the user entered ?
> I need it for creating entries in proc for example.

It's probably worth to note here - the dm target should always care ONLY about 
major:minor - it should never care about the name of device.
It looks like you are doing something weird in your target.

Regards

Zdeenk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06 11:20 ` Zdenek Kabelac
@ 2015-07-06 12:04   ` Gili B
  2015-07-06 12:19     ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Gili B @ 2015-07-06 12:04 UTC (permalink / raw)
  To: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 1296 bytes --]

Thanks
My module is creating target similar to pool and thin from dm_thin.c. 
if the user creates a pool named "Pool1", and now he wishes
to watch statistics/inside info regarding this pool,
I wanted to create a proc entry
/proc/my module name/pools/Pool1 
 
for that I need the pool name which now it seems to me that I cannot find out.
 
I can ask the user to add another parameter during the pool creation, but seems
Like an overhead and I'll need to do some extra verefications etc.
 
Regards
-gili

 
> To: dm-devel@redhat.com
> From: zdenek.kabelac@gmail.com
> Date: Mon, 6 Jul 2015 13:20:38 +0200
> Subject: Re: [dm-devel] Getting mapped device namw
> 
> Dne 6.7.2015 v 11:20 Gili B napsal(a):
> > hi
> > when a user run :
> > dmsetup create [device name] ....
> > Can a device mapper target find out the device name that the user entered ?
> > I need it for creating entries in proc for example.
> 
> It's probably worth to note here - the dm target should always care ONLY about 
> major:minor - it should never care about the name of device.
> It looks like you are doing something weird in your target.
> 
> Regards
> 
> Zdeenk
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1736 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06 12:04   ` Gili B
@ 2015-07-06 12:19     ` Zdenek Kabelac
  2015-07-07  6:22       ` Gili B
  0 siblings, 1 reply; 10+ messages in thread
From: Zdenek Kabelac @ 2015-07-06 12:19 UTC (permalink / raw)
  To: device-mapper development

Dne 6.7.2015 v 14:04 Gili B napsal(a):
> Thanks
> My module is creating target similar to pool and thin from dm_thin.c.
> if the user creates a pool named "Pool1", and now he wishes

Have you checked  dm statistic support ?

https://www.kernel.org/doc/Documentation/device-mapper/statistics.txt

Zdenek

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06 12:19     ` Zdenek Kabelac
@ 2015-07-07  6:22       ` Gili B
  2015-07-07  6:30         ` Zdenek Kabelac
  0 siblings, 1 reply; 10+ messages in thread
From: Gili B @ 2015-07-07  6:22 UTC (permalink / raw)
  To: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 1161 bytes --]

Thanks
I've looked at it and it loks like something that can assist us.
The general info mechanism we are working on requires more that just statistics though.
Regarding the statistics :
When I run dmsetup (centos 6.5)  on my device, it sais that my target doesnt support messages(ha because we 
didn't implement any yet ) , from the description in the link you've sent, it sounds like any dm target inherits
this functionality.
Are there any methods I need to call, or do I need to re-implement this in my target?
 
Thanks
-gili
 
> To: dm-devel@redhat.com
> From: zkabelac@redhat.com
> Date: Mon, 6 Jul 2015 14:19:42 +0200
> Subject: Re: [dm-devel] Getting mapped device namw
> 
> Dne 6.7.2015 v 14:04 Gili B napsal(a):
> > Thanks
> > My module is creating target similar to pool and thin from dm_thin.c.
> > if the user creates a pool named "Pool1", and now he wishes
> 
> Have you checked  dm statistic support ?
> 
> https://www.kernel.org/doc/Documentation/device-mapper/statistics.txt
> 
> Zdenek
> 
> 
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1582 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-07  6:22       ` Gili B
@ 2015-07-07  6:30         ` Zdenek Kabelac
  0 siblings, 0 replies; 10+ messages in thread
From: Zdenek Kabelac @ 2015-07-07  6:30 UTC (permalink / raw)
  To: device-mapper development

Dne 7.7.2015 v 08:22 Gili B napsal(a):
> Thanks
> I've looked at it and it loks like something that can assist us.
> The general info mechanism we are working on requires more that just
> statistics though.
> Regarding the statistics :
> When I run dmsetup (centos 6.5)  on my device, it sais that my target doesnt

Centos 6.5 is way too old for this feature.
It appears in 7.2.

Zdenek

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Getting mapped device namw
  2015-07-06  9:49     ` Nikolay Borisov
@ 2015-07-08  5:56       ` Gili B
  0 siblings, 0 replies; 10+ messages in thread
From: Gili B @ 2015-07-08  5:56 UTC (permalink / raw)
  To: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 2732 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 3771 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-08  5:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-06  9:20 Getting mapped device namw Gili B
2015-07-06  9:32 ` Nikolay Borisov
2015-07-06  9:40   ` Gili B
2015-07-06  9:49     ` Nikolay Borisov
2015-07-08  5:56       ` Gili B
2015-07-06 11:20 ` Zdenek Kabelac
2015-07-06 12:04   ` Gili B
2015-07-06 12:19     ` Zdenek Kabelac
2015-07-07  6:22       ` Gili B
2015-07-07  6:30         ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.