svn commit: r274165 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Nov 6 07:37:32 UTC 2014


Author: mjg
Date: Thu Nov  6 07:37:31 2014
New Revision: 274165
URL: https://svnweb.freebsd.org/changeset/base/274165

Log:
  filedesc: just free old tables without altering the list which is freed anyway
  
  No functional changes.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Thu Nov  6 07:27:14 2014	(r274164)
+++ head/sys/kern/kern_descrip.c	Thu Nov  6 07:37:31 2014	(r274165)
@@ -2026,7 +2026,7 @@ fdescfree(struct thread *td)
 {
 	struct filedesc0 *fdp0;
 	struct filedesc *fdp;
-	struct freetable *ft;
+	struct freetable *ft, *tft;
 	struct filedescent *fde;
 	struct file *fp;
 	struct vnode *cdir, *jdir, *rdir;
@@ -2078,10 +2078,8 @@ fdescfree(struct thread *td)
 		free(fdp->fd_files, M_FILEDESC);
 
 	fdp0 = (struct filedesc0 *)fdp;
-	while ((ft = SLIST_FIRST(&fdp0->fd_free)) != NULL) {
-		SLIST_REMOVE_HEAD(&fdp0->fd_free, ft_next);
+	SLIST_FOREACH_SAFE(ft, &fdp0->fd_free, ft_next, tft)
 		free(ft->ft_table, M_FILEDESC);
-	}
 
 	if (cdir != NULL)
 		vrele(cdir);


More information about the svn-src-all mailing list