summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2015-06-10 10:48:12 +0000
committermjg <mjg@FreeBSD.org>2015-06-10 10:48:12 +0000
commitd7bc9285a673d676370f95a84ce93ef553c8688c (patch)
treedbbb077ee034cbfe839c1ba19dbe5ce374a5c6a3 /sys/fs/fdescfs
parent67f2eebb44e1f27017750eddaf5a5ea513cb9c71 (diff)
downloadFreeBSD-src-d7bc9285a673d676370f95a84ce93ef553c8688c.zip
FreeBSD-src-d7bc9285a673d676370f95a84ce93ef553c8688c.tar.gz
Implement lockless resource limits.
Use the same scheme implemented to manage credentials. Code needing to look at process's credentials (as opposed to thred's) is provided with *_proc variants of relevant functions. Places which possibly had to take the proc lock anyway still use the proc pointer to access limits.
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r--sys/fs/fdescfs/fdesc_vfsops.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c
index d3d8ce0..f379c5a 100644
--- a/sys/fs/fdescfs/fdesc_vfsops.c
+++ b/sys/fs/fdescfs/fdesc_vfsops.c
@@ -199,9 +199,7 @@ fdesc_statfs(mp, sbp)
* limit is ever reduced below the current number
* of open files... ]
*/
- PROC_LOCK(td->td_proc);
- lim = lim_cur(td->td_proc, RLIMIT_NOFILE);
- PROC_UNLOCK(td->td_proc);
+ lim = lim_cur(td, RLIMIT_NOFILE);
fdp = td->td_proc->p_fd;
FILEDESC_SLOCK(fdp);
limit = racct_get_limit(td->td_proc, RACCT_NOFILE);
OpenPOWER on IntegriCloud