Seigo Tanimura wrote:
> A quick and hopefully efficient solution to those problems is to
> fhold() struct file's first, then enter polling loop. That seems much
> cheaper than to work on free()ing a vnode or a socket with holding a
> process lock, provided that struct filedesc and file are protected
> properly (and we have to do it anyway).

Let me once again point out that fhold(), like crhold(),
should act as an l-valued function that takes an r-value
as an "argument", as in:

        a = crhold(b);
        q = fhold(r);
etc. (for all such functions).

The reason is that you can not replace it with an instrumented
function, otherwise, which would permit you to catch subtle
errors that:

        a = b;
        q = r;

etc. may cause (yes, I know I have held the r-calue in one
case and the l-value in the other in the above example; the
kernel itself does this all over the place, and I think it's
an error).

I also think that they should use common base macros: it is
exceedingly dangerous to have multiple hold semantics in the

-- Terry

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

Reply via email to