freebsd-dev/sys/opencrypto
David Malone e1419c08e2 falloc allocates a file structure and adds it to the file descriptor
table, acquiring the necessary locks as it works. It usually returns
two references to the new descriptor: one in the descriptor table
and one via a pointer argument.

As falloc releases the FILEDESC lock before returning, there is a
potential for a process to close the reference in the file descriptor
table before falloc's caller gets to use the file. I don't think this
can happen in practice at the moment, because Giant indirectly protects
closes.

To stop the file being completly closed in this situation, this change
makes falloc set the refcount to two when both references are returned.
This makes life easier for several of falloc's callers, because the
first thing they previously did was grab an extra reference on the
file.

Reviewed by:	iedowse
Idea run past:	jhb
2003-10-19 20:41:07 +00:00
..
cast.c
cast.h
castsb.h
criov.c
crmbuf.c
crypto_if.m
crypto.c consolidate callback optimization check in one location by adding a flag 2003-06-30 05:09:32 +00:00
cryptodev.c falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
cryptodev.h consolidate callback optimization check in one location by adding a flag 2003-06-30 05:09:32 +00:00
cryptosoft.c
cryptosoft.h
deflate.c
deflate.h
rijndael.c
rijndael.h
rmd160.c
rmd160.h
skipjack.c
skipjack.h
xform.c
xform.h