ufs does not access the [Nn]blocks and [Ss]ize properties,
but the ldi and specfs do.  so if you were to do a stat(2) on your
device before it was opened, you would get an incorrect size reported.

most native block devices do something like ddi_prop_op_nblocks().
(search for callers of this function to see how they use it.)

in the case of a layered driver, what you should do depends on what
the layered driver does.  if the size of your layered device is the
same as that of the device that you're layering over then you can
probalby just call ldi_prop_op() to pass on prop_op requests.  (assuming
of course that the device you're layering supports these dynamic
properties.)  if the size of your layered device is different from
that of the device and/or devices that your layered over then you'll
need to do the size calculation yourself and you can probably use
ddi_prop_op_nblocks() to help you with reporting the size.

ed

On Mon, May 14, 2007 at 04:14:03PM -0700, Shweta Krishnan wrote:
> Thanks Edward.
> Currently my layered driver does not implement the prop_op(9E) entry point - 
> I didn't realize this was necessary since my layered driver worked fine 
> without it when used over UFS.
> My layered driver sits above a ramdisk driver.
>
> I realized the same problem that you've mentioned when I was narrowing in on 
> ldi_get_size() today, and so tried to retrive the N/nblocks property for the 
> underlying device in my layered driver.
> Had some issues with that, and yet to figure it out.
>
> Any pointers on what other stuff the prop_op(9E) entry point should do for a 
> block driver ?
>
> Thanks,
> Shweta.
>
>
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-discuss mailing list
> opensolaris-discuss@opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to