diff options
author | jeff <jeff@FreeBSD.org> | 2007-12-30 01:42:15 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-12-30 01:42:15 +0000 |
commit | ce1863880500c459eb1395c1d6f81819e02e6608 (patch) | |
tree | 0f2354bfc200294c2629e6ecfba76e364beda579 /sys/opencrypto/cryptodev.c | |
parent | bedce823534f9510ef9c65764069f927d359aeb8 (diff) | |
download | FreeBSD-src-ce1863880500c459eb1395c1d6f81819e02e6608.zip FreeBSD-src-ce1863880500c459eb1395c1d6f81819e02e6608.tar.gz |
Remove explicit locking of struct file.
- Introduce a finit() which is used to initailize the fields of struct file
in such a way that the ops vector is only valid after the data, type,
and flags are valid.
- Protect f_flag and f_count with atomic operations.
- Remove the global list of all files and associated accounting.
- Rewrite the unp garbage collection such that it no longer requires
the global list of all files and instead uses a list of all unp sockets.
- Mark sockets in the accept queue so we don't incorrectly gc them.
Tested by: kris, pho
Diffstat (limited to 'sys/opencrypto/cryptodev.c')
-rw-r--r-- | sys/opencrypto/cryptodev.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index a940a3c..c9fc6d2 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -840,12 +840,7 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread return (error); } /* falloc automatically provides an extra reference to 'f'. */ - FILE_LOCK(f); - f->f_flag = FREAD | FWRITE; - f->f_type = DTYPE_CRYPTO; - f->f_data = fcr; - f->f_ops = &cryptofops; - FILE_UNLOCK(f); + finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops); *(u_int32_t *)data = fd; fdrop(f, td); break; |