+
+int
+frele(struct file *fp)
+{
+ int count;
+ funnel_t * fnl;
+ extern int disable_funnel;
+
+ fnl = thread_funnel_get();
+ /*
+ * If the funnels are merged then atleast a funnel should be held
+ * else frele should come in with kernel funnel only
+ */
+ if (!disable_funnel && (fnl != kernel_flock)) {
+ panic("frele: kernel funnel not held");
+
+ } else if (fnl == THR_FUNNEL_NULL) {
+ panic("frele: no funnel held");
+ }
+
+ if ((count = frele_internal(fp)) == 0) {
+ /* some one closed the fd while we were blocked */
+ (void)closef_finish(fp, current_proc());
+ }
+ return(count);
+}
+