]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 6 Dec 2011 11:24:03 +0000 (11:24 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 6 Dec 2011 11:24:03 +0000 (11:24 +0000)
commit93c26de0addd35b3098b02bab7c20df1f888c743
tree4991fc8f0939a0565805b4cebbf3b5db11f617b8
parent2266ba7b124eabb81a46b6e0a2354cb6264c7b82
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