+
+static __inline int fo_read __P((struct file *fp, struct uio *uio,
+ struct ucred *cred, int flags, struct proc *p));
+static __inline int fo_write __P((struct file *fp, struct uio *uio,
+ struct ucred *cred, int flags, struct proc *p));
+static __inline int fo_ioctl __P((struct file *fp, u_long com, caddr_t data,
+ struct proc *p));
+static __inline int fo_select __P((struct file *fp, int which, void *wql,
+ struct proc *p));
+static __inline int fo_close __P((struct file *fp, struct proc *p));
+
+static __inline int
+fo_read(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct proc *p)
+{
+ int error;
+
+ if ((error = fref(fp)) == -1)
+ return (EBADF);
+ error = (*fp->f_ops->fo_read)(fp, uio, cred, flags, p);
+ frele(fp);
+ return (error);
+}
+
+static __inline int
+fo_write(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct proc *p)
+{
+ int error;
+
+ if ((error = fref(fp)) == -1)
+ return (EBADF);
+ error = (*fp->f_ops->fo_write)(fp, uio, cred, flags, p);
+ frele(fp);
+ return (error);
+}
+
+static __inline int
+fo_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p)
+{
+ int error;
+
+ if ((error = fref(fp)) == -1)
+ return (EBADF);
+ error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
+ frele(fp);
+ return (error);
+}
+
+static __inline int
+fo_select(struct file *fp, int which, void *wql, struct proc *p)
+{
+ int error;
+
+ error = (*fp->f_ops->fo_select)(fp, which, wql, p);
+ return (error);
+}
+
+static __inline int
+fo_close(struct file *fp, struct proc *p)
+{
+
+ return ((*fp->f_ops->fo_close)(fp, p));
+}