PERFORCE change 200718 for review
John Baldwin
jhb at FreeBSD.org
Tue Oct 25 21:37:24 UTC 2011
http://p4web.freebsd.org/@@200718?ac=10
Change 200718 by jhb at 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);
More information about the p4-projects
mailing list