]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
authorkib <kib@FreeBSD.org>
Tue, 6 Dec 2011 11:24:03 +0000 (11:24 +0000)
committerkib <kib@FreeBSD.org>
Tue, 6 Dec 2011 11:24:03 +0000 (11:24 +0000)
commit12e8232d4db8b80e5a4da1575bcfad518f1f867b
tree4991fc8f0939a0565805b4cebbf3b5db11f617b8
parentf8f306b32a4ee9cf17446f1997817dafecceb424
Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
Optimize for the case, by lazily allocating the pipe inode number at the
fstat(2) time. If alloc_unr(9) returns failure, do not fail fstat(2), since
uses of inode numbers are even rare then fstat(2), but provide zero inode
forever. Note that alloc_unr() failure is unlikely due to total number
of pipes in the system limited by the number of file descriptors.

Based on the submission by: gianni
MFC after: 2 weeks
sys/kern/sys_pipe.c