+
+static int
+vn_kqfilt_add(fp, kn, p)
+ struct file *fp;
+ struct knote *kn;
+ struct proc *p;
+{
+ struct vnode *vp = (struct vnode *)fp->f_data;
+ int error;
+
+ error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ if (error) return (error);
+ error = VOP_KQFILT_ADD(vp, kn, p);
+ (void)VOP_UNLOCK(vp, 0, p);
+ return (error);
+}
+
+static int
+vn_kqfilt_remove(vp, ident, p)
+ struct vnode *vp;
+ uintptr_t ident;
+ struct proc *p;
+{
+ int error;
+
+ error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ if (error) return (error);
+ error = VOP_KQFILT_REMOVE(vp, ident, p);
+ (void)VOP_UNLOCK(vp, 0, p);
+ return (error);
+}