aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2012-06-14 15:35:14 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2012-06-14 15:35:14 +0000
commit215aeba93932fb6260242f93a5cddb33e5463d81 (patch)
tree9f7cd4022bb1fb617e776a353bf2217478eb8ac7 /sys
parent7aef754274f86dd13896bbef2f1ed0fcdbf356b1 (diff)
- Assert that the filedesc lock is being held when fdisused() is called.
- Fix white spaces. MFC after: 1 month
Notes
svn path=/head/; revision=237076
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_descrip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index bf3d01d3bdb8..e2fbedf25ad9 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -243,8 +243,10 @@ static int
fdisused(struct filedesc *fdp, int fd)
{
- KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
- ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles));
+ FILEDESC_LOCK_ASSERT(fdp);
+
+ KASSERT(fd >= 0 && fd < fdp->fd_nfiles,
+ ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles));
return ((fdp->fd_map[NDSLOT(fd)] & NDBIT(fd)) != 0);
}