Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2011 21:37:23 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 200718 for review
Message-ID:  <201110252137.p9PLbN19018921@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@200718?ac=10

Change 200718 by jhb@jhb_jhbbsd on 2011/10/25 21:36:42

	Move devfs_fpdrop() into devfs_close_f() since it only
	applies to DTYPE_DEV devices.  This makes it possible to
	reuse f_cdevpriv for other file types for something else.

Affected files ...

.. //depot/projects/fadvise/sys/fs/devfs/devfs_vnops.c#2 edit
.. //depot/projects/fadvise/sys/kern/kern_descrip.c#3 edit

Differences ...

==== //depot/projects/fadvise/sys/fs/devfs/devfs_vnops.c#2 (text+ko) ====

@@ -604,6 +604,13 @@
 	td->td_fpop = fp;
 	error = vnops.fo_close(fp, td);
 	td->td_fpop = fpop;
+
+	/*
+	 * The f_cdevpriv cannot be assigned non-NULL value while we
+	 * are destroying the file.
+	 */
+	if (fp->f_cdevpriv != NULL)
+		devfs_fpdrop(fp);
 	return (error);
 }
 

==== //depot/projects/fadvise/sys/kern/kern_descrip.c#3 (text+ko) ====

@@ -2576,12 +2576,6 @@
 		panic("fdrop: count %d", fp->f_count);
 	if (fp->f_ops != &badfileops)
 		error = fo_close(fp, td);
-	/*
-	 * The f_cdevpriv cannot be assigned non-NULL value while we
-	 * are destroying the file.
-	 */
-	if (fp->f_cdevpriv != NULL)
-		devfs_fpdrop(fp);
 	atomic_subtract_int(&openfiles, 1);
 	crfree(fp->f_cred);
 	uma_zfree(file_zone, fp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110252137.p9PLbN19018921>