svn commit: r237076 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jun 14 15:35:15 UTC 2012


Author: pjd
Date: Thu Jun 14 15:35:14 2012
New Revision: 237076
URL: http://svn.freebsd.org/changeset/base/237076

Log:
  - Assert that the filedesc lock is being held when fdisused() is called.
  - Fix white spaces.
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Thu Jun 14 15:34:10 2012	(r237075)
+++ head/sys/kern/kern_descrip.c	Thu Jun 14 15:35:14 2012	(r237076)
@@ -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);
 }


More information about the svn-src-head mailing list