From f1bec1965343db9a80a80e7ed55ee2fe5dd36253 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 4 Dec 2001 22:44:33 +0000 Subject: Readd VOP_MMAP, will be used soon. Right now it's just a question to the filesystem if we're allowed to mmap the file. --- sys/kern/vnode_if.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sys/kern/vnode_if.c') diff --git a/sys/kern/vnode_if.c b/sys/kern/vnode_if.c index 986936fc8b6..6ef2712d257 100644 --- a/sys/kern/vnode_if.c +++ b/sys/kern/vnode_if.c @@ -1364,6 +1364,37 @@ int VOP_SIZE(vp, size, eobp) return (VCALL(vp, VOFFSET(vop_size), &a)); } +int vop_mmap_vp_offsets[] = { + VOPARG_OFFSETOF(struct vop_mmap_args,a_vp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vop_mmap_desc = { + 0, + "vop_mmap", + 0, + vop_mmap_vp_offsets, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vop_mmap_args, a_cred), + VOPARG_OFFSETOF(struct vop_mmap_args, a_p), + VDESC_NO_OFFSET, + NULL, +}; + +int VOP_MMAP(vp, fflags, cred, p) + struct vnode *vp; + int fflags; + struct ucred *cred; + struct proc *p; +{ + struct vop_mmap_args a; + a.a_desc = VDESC(vop_mmap); + a.a_vp = vp; + a.a_fflags = fflags; + a.a_cred = cred; + a.a_p = p; + return (VCALL(vp, VOFFSET(vop_mmap), &a)); +} + /* Special cases: */ int vop_strategy_vp_offsets[] = { @@ -1461,6 +1492,7 @@ struct vnodeop_desc *vfs_op_descs[] = { &vop_getpages_desc, &vop_putpages_desc, &vop_size_desc, + &vop_mmap_desc, NULL }; -- cgit v1.2.3