SCCS-vsn: sys/kern/vfs_vnops.c 7.33
SCCS-vsn: sys/sys/vnode.h 7.39
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)vfs_vnops.c 7.32 (Berkeley) %G%
+ * @(#)vfs_vnops.c 7.33 (Berkeley) %G%
#include "tty.h"
struct fileops vnops =
#include "tty.h"
struct fileops vnops =
- { vn_read, vn_write, vn_ioctl, vn_select, vn_close };
+ { vn_read, vn_write, vn_ioctl, vn_select, vn_closefile };
/*
* Common code for vnode open operations.
/*
* Common code for vnode open operations.
- * Vnode version of rdwri() for calls on file systems.
+ * Vnode close call
+ */
+vn_close(vp, flags, cred, p)
+ register struct vnode *vp;
+ int flags;
+ struct ucred *cred;
+ struct proc *p;
+{
+ int error;
+
+ if (flags & FWRITE)
+ vp->v_writecount--;
+ error = VOP_CLOSE(vp, flags, cred, p);
+ vrele(vp);
+ return (error);
+}
+
+/*
+ * Package up an I/O request on a vnode into a uio and do it.
*/
vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, p)
enum uio_rw rw;
*/
vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid, p)
enum uio_rw rw;
+/*
+ * File table vnode read routine.
+ */
vn_read(fp, uio, cred)
struct file *fp;
struct uio *uio;
vn_read(fp, uio, cred)
struct file *fp;
struct uio *uio;
+/*
+ * File table vnode write routine.
+ */
vn_write(fp, uio, cred)
struct file *fp;
struct uio *uio;
vn_write(fp, uio, cred)
struct file *fp;
struct uio *uio;
- * Get stat info for a vnode.
+ * File table vnode stat routine.
*/
vn_stat(vp, sb, p)
struct vnode *vp;
*/
vn_stat(vp, sb, p)
struct vnode *vp;
+ * File table vnode ioctl routine.
*/
vn_ioctl(fp, com, data, p)
struct file *fp;
*/
vn_ioctl(fp, com, data, p)
struct file *fp;
+ * File table vnode select routine.
*/
vn_select(fp, which, p)
struct file *fp;
*/
vn_select(fp, which, p)
struct file *fp;
{
return (VOP_SELECT(((struct vnode *)fp->f_data), which, fp->f_flag,
{
return (VOP_SELECT(((struct vnode *)fp->f_data), which, fp->f_flag,
+ * File table vnode close routine.
-vn_close(vp, flags, cred, p)
- register struct vnode *vp;
- int flags;
- struct ucred *cred;
+vn_closefile(fp, p)
+ struct file *fp;
- if (flags & FWRITE)
- vp->v_writecount--;
- error = VOP_CLOSE(vp, flags, cred, p);
- vrele(vp);
- return (error);
+ return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
+ fp->f_cred, p));
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)vnode.h 7.38 (Berkeley) %G%
+ * @(#)vnode.h 7.39 (Berkeley) %G%
int vn_write __P((struct file *fp, struct uio *uio, struct ucred *cred));
int vn_ioctl __P((struct file *fp, int com, caddr_t data, struct proc *p));
int vn_select __P((struct file *fp, int which, struct proc *p));
int vn_write __P((struct file *fp, struct uio *uio, struct ucred *cred));
int vn_ioctl __P((struct file *fp, int com, caddr_t data, struct proc *p));
int vn_select __P((struct file *fp, int which, struct proc *p));
+int vn_closefile __P((struct file *fp, struct proc *p));
int getnewvnode __P((enum vtagtype tag, struct mount *mp,
struct vnodeops *vops, struct vnode **vpp));
int bdevvp __P((int dev, struct vnode **vpp));
int getnewvnode __P((enum vtagtype tag, struct mount *mp,
struct vnodeops *vops, struct vnode **vpp));
int bdevvp __P((int dev, struct vnode **vpp));