summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2014-06-22 01:31:55 +0000
committermjg <mjg@FreeBSD.org>2014-06-22 01:31:55 +0000
commitd74326bc91b75e4a8f54bcc1fdb0a83ab223e560 (patch)
treeda5e63a89bfc99a89e509c6cae0e1bd9a50d4de5 /sys/kern/vfs_syscalls.c
parent38cd838637eab022e13231e78d0727fb8ac4da12 (diff)
downloadFreeBSD-src-d74326bc91b75e4a8f54bcc1fdb0a83ab223e560.zip
FreeBSD-src-d74326bc91b75e4a8f54bcc1fdb0a83ab223e560.tar.gz
fd: replace fd_nfiles with fd_lastfile where appropriate
fd_lastfile is guaranteed to be the biggest open fd, so when the intent is to iterate over active fds or lookup one, there is no point in looking beyond that limit. Few places are left unpatched for now. MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 8481fb4..7aa457e 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -828,7 +828,7 @@ chroot_refuse_vdir_fds(fdp)
FILEDESC_LOCK_ASSERT(fdp);
- for (fd = 0; fd < fdp->fd_nfiles ; fd++) {
+ for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
fp = fget_locked(fdp, fd);
if (fp == NULL)
continue;
OpenPOWER on IntegriCloud