/* $NetBSD: tmpfs_fifoops.c,v 1.5 2005/12/11 12:24:29 christos Exp $ */12/*-3* SPDX-License-Identifier: BSD-2-Clause4*5* Copyright (c) 2005 The NetBSD Foundation, Inc.6* All rights reserved.7*8* This code is derived from software contributed to The NetBSD Foundation9* by Julio M. Merino Vidal, developed as part of Google's Summer of Code10* 2005 program.11*12* Redistribution and use in source and binary forms, with or without13* modification, are permitted provided that the following conditions14* are met:15* 1. Redistributions of source code must retain the above copyright16* notice, this list of conditions and the following disclaimer.17* 2. Redistributions in binary form must reproduce the above copyright18* notice, this list of conditions and the following disclaimer in the19* documentation and/or other materials provided with the distribution.20*21* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS22* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED23* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR24* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS25* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR26* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF27* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS28* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN29* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)30* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31* POSSIBILITY OF SUCH DAMAGE.32*/3334/*35* tmpfs vnode interface for named pipes.36*/3738#include <sys/param.h>39#include <sys/mount.h>40#include <sys/proc.h>41#include <sys/vnode.h>4243#include <vm/vm.h>44#include <vm/vm_object.h>4546#include <fs/tmpfs/tmpfs.h>47#include <fs/tmpfs/tmpfs_fifoops.h>48#include <fs/tmpfs/tmpfs_vnops.h>4950static int51tmpfs_fifo_close(struct vop_close_args *v)52{53struct tmpfs_node *node;5455node = VP_TO_TMPFS_NODE(v->a_vp);56tmpfs_set_accessed(VFS_TO_TMPFS(v->a_vp->v_mount), node);57tmpfs_update(v->a_vp);58return (fifo_specops.vop_close(v));59}6061/*62* vnode operations vector used for fifos stored in a tmpfs file system.63*/64struct vop_vector tmpfs_fifoop_entries = {65.vop_default = &fifo_specops,66.vop_close = tmpfs_fifo_close,67.vop_reclaim = tmpfs_reclaim,68.vop_access = tmpfs_access,69.vop_getattr = tmpfs_getattr,70.vop_setattr = tmpfs_setattr,71.vop_pathconf = tmpfs_pathconf,72.vop_print = tmpfs_print,73.vop_add_writecount = vop_stdadd_writecount_nomsync,74.vop_fplookup_vexec = VOP_EAGAIN,75.vop_fplookup_symlink = VOP_EAGAIN,76};77VFS_VOP_VECTOR_REGISTER(tmpfs_fifoop_entries);787980