Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Nov 2000 15:08:24 -0500
From:      Marcel Moolenaar <marcel@cup.hp.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Andrew Gallatin <gallatin@cs.duke.edu>, freebsd-current@FreeBSD.ORG
Subject:   Re: linux emulation
Message-ID:  <3A007838.25121ACC@cup.hp.com>
References:  <22496.973107332@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ?

Correct.

> 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
[snip]

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
  mail: marcel@cup.hp.com / marcel@FreeBSD.org
  tel:  (408) 447-4222


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A007838.25121ACC>