mirror of
https://github.com/opnsense/src.git
synced 2026-04-07 10:25:46 -04:00
Seigo Tanimura (tanimura) posted the initial delta.
I've polished it quite a bit reducing the need for locking and
adapting it for KSE.
Locks:
1 mutex in each filedesc
protects all the fields.
protects "struct file" initialization, while a struct file
is being changed from &badfileops -> &pipeops or something
the filedesc should be locked.
1 mutex in each struct file
protects the refcount fields.
doesn't protect anything else.
the flags used for garbage collection have been moved to
f_gcflag which was the FILLER short, this doesn't need
locking because the garbage collection is a single threaded
container.
could likely be made to use a pool mutex.
1 sx lock for the global filelist.
struct file * fhold(struct file *fp);
/* increments reference count on a file */
struct file * fhold_locked(struct file *fp);
/* like fhold but expects file to locked */
struct file * ffind_hold(struct thread *, int fd);
/* finds the struct file in thread, adds one reference and
returns it unlocked */
struct file * ffind_lock(struct thread *, int fd);
/* ffind_hold, but returns file locked */
I still have to smp-safe the fget cruft, I'll get to that asap.
|
||
|---|---|---|
| .. | ||
| default_pager.c | ||
| device_pager.c | ||
| phys_pager.c | ||
| pmap.h | ||
| swap_pager.c | ||
| swap_pager.h | ||
| vm.h | ||
| vm_contig.c | ||
| vm_extern.h | ||
| vm_fault.c | ||
| vm_glue.c | ||
| vm_init.c | ||
| vm_kern.c | ||
| vm_kern.h | ||
| vm_map.c | ||
| vm_map.h | ||
| vm_meter.c | ||
| vm_mmap.c | ||
| vm_object.c | ||
| vm_object.h | ||
| vm_page.c | ||
| vm_page.h | ||
| vm_pageout.c | ||
| vm_pageout.h | ||
| vm_pageq.c | ||
| vm_pager.c | ||
| vm_pager.h | ||
| vm_param.h | ||
| vm_swap.c | ||
| vm_unix.c | ||
| vm_zeroidle.c | ||
| vm_zone.c | ||
| vm_zone.h | ||
| vnode_pager.c | ||
| vnode_pager.h | ||