Poul-Henning Kamp wrote:
> >In short: given the (u)dev_t, get the FS statistics and return the
> >number of free blocks and inodes of the FS on that device.
> But the udev_t is a (32bit truncated to) 16bit one, right ?


> In that case it will usually not work:
> crw-r-----  1 root  operator  116, 0x00010002  1 Jan  1970 /dev/ad0
> crw-r-----  1 root  operator  116, 0x00020000  1 Jan  1970 /dev/ad0s1a

It won't always work.

> Considering the fact that we were likely to return statistics for the
> wrong filesystem with the old code, and most likely cannot return
> the right statistics anyway, I think we should just return zero
> for those values (or some other more sensible values)

I think we should try to return the right statistics in the case where
we have it wrong now instead of returning the wrong statistics in the
case where we have it right now. When we have it wrong, we're likely to
return zero anyway. The only case that pops up in my mind that may cause
us to return the statistics of a different device than the one intended
is when the minor number is a sequence and we've truncated sequence S,
with S > 255 into S % 255. This is not very likely. Hmmm... the strange
assignment of NFS mounts might be a problem as well (warning: vague
recollections in combination with memory leaks of dated info and mental
cross-talk may make this statement slightly off :-)

Marcel Moolenaar
  tel:  (408) 447-4222

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to