While doing a zio we have the information about what pool and dataset we are operating on encoded in a zbookmark_t. I found I can go from a object to a dataset name using dsl_dsobj_to_dsname() but that needs a pool name. The reason I need the dataset name is to be able to call dsl_prop_get() so I can lookup the key which I''m storing as a property (one that won''t be visible over the ioctl). So I do I go from z zbookmark_t to a pool name ? I''ve looked in a few header files and I couldn''t find anything obvious. -- Darren J Moffat
Darren J Moffat wrote:> While doing a zio we have the information about what pool and dataset we > are operating on encoded in a zbookmark_t. > > I found I can go from a object to a dataset name using > dsl_dsobj_to_dsname() but that needs a pool name. > > The reason I need the dataset name is to be able to call dsl_prop_get() > so I can lookup the key which I''m storing as a property (one that won''t > be visible over the ioctl). > > So I do I go from z zbookmark_t to a pool name ?You can''t. But if you have a zio_t, just use io_spa. Better yet, don''t convert to a name at all. Use dsl_dataset_open_obj() and dsl_prop_get_ds() (which mysteriously isn''t in the header file, but you can add it). --matt
Matthew Ahrens wrote:>> So I do I go from z zbookmark_t to a pool name ? > > You can''t. > > But if you have a zio_t, just use io_spa. > > Better yet, don''t convert to a name at all. Use dsl_dataset_open_obj() > and dsl_prop_get_ds() (which mysteriously isn''t in the header file, but > you can add it).Not being in the header is probably why I didn''t find it! Thanks that looks like it will do what I need for getting the dsl property. -- Darren J Moffat