aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/fifofs/fifo_vnops.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2007-12-30 01:42:15 +0000
committerJeff Roberson <jeff@FreeBSD.org>2007-12-30 01:42:15 +0000
commit397c19d1753d210247d77eb3ca33d1c7c1eb2fa9 (patch)
tree0f2354bfc200294c2629e6ecfba76e364beda579 /sys/fs/fifofs/fifo_vnops.c
parent2a79fd39b4cf409d2c0bd7a449d7f3e91d7b9007 (diff)
downloadsrc-397c19d1753d210247d77eb3ca33d1c7c1eb2fa9.tar.gz
src-397c19d1753d210247d77eb3ca33d1c7c1eb2fa9.zip
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
Notes
Notes: svn path=/head/; revision=174988
Diffstat (limited to 'sys/fs/fifofs/fifo_vnops.c')
-rw-r--r--sys/fs/fifofs/fifo_vnops.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index 2d3254f968dd..78718dbfed60 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -294,11 +294,8 @@ fail1:
}
mtx_unlock(&fifo_mtx);
KASSERT(fp != NULL, ("can't fifo/vnode bypass"));
- FILE_LOCK(fp);
KASSERT(fp->f_ops == &badfileops, ("not badfileops in fifo_open"));
- fp->f_data = fip;
- fp->f_ops = &fifo_ops_f;
- FILE_UNLOCK(fp);
+ finit(fp, fp->f_flag, DTYPE_FIFO, fip, &fifo_ops_f);
return (0);
}