svn commit: r286142 - head/sys/net

Luiz Otavio O Souza loos.br at gmail.com
Mon Aug 3 18:45:42 UTC 2015


On Sat, Aug 1, 2015 at 6:02 PM, Guy Helmer wrote:
>
>> On Aug 1, 2015, at 4:50 AM, Ed Schouten wrote:
>>
>> Hi Luiz,
>>
>> 2015-07-31 23:43 GMT+02:00 Luiz Otavio O Souza <loos at freebsd.org>:
>>> -               while (d->bd_hbuf_in_use)
>>> -                       mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock,
>>> -                           PRINET, "bd_hbuf", 0);
>>
>> Would it make sense to replace them by an assertion, instead of
>> omitting them entirely?
>>
>> KASSERT(!d->bd_hbuf_in_use, ("..."));
>
> I would appreciate the confidence that would provide.
>
> Guy

Yeah, I agree.  The KASSERT() makes the code even easier to understand.

Note that only one KASSERT() is needed here, because to other case is
specific to zero-copy buffers and the zero-copy buffers cannot be read
with read(2) and this way they never set the in use flag for the hold
buffer.

Committed in r286243.

Thanks!

Luiz


More information about the svn-src-all mailing list