Home | History | Annotate | Line # | Download | only in nullfs
null_vnops.c revision 1.40
      1  1.40   hannken /*	$NetBSD: null_vnops.c,v 1.40 2017/01/27 10:47:13 hannken Exp $	*/
      2   1.2       cgd 
      3   1.1   mycroft /*
      4  1.16  wrstuden  * Copyright (c) 1999 National Aeronautics & Space Administration
      5  1.16  wrstuden  * All rights reserved.
      6  1.16  wrstuden  *
      7  1.16  wrstuden  * This software was written by William Studenmund of the
      8  1.19       wiz  * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
      9  1.16  wrstuden  *
     10  1.16  wrstuden  * Redistribution and use in source and binary forms, with or without
     11  1.16  wrstuden  * modification, are permitted provided that the following conditions
     12  1.16  wrstuden  * are met:
     13  1.16  wrstuden  * 1. Redistributions of source code must retain the above copyright
     14  1.16  wrstuden  *    notice, this list of conditions and the following disclaimer.
     15  1.16  wrstuden  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.16  wrstuden  *    notice, this list of conditions and the following disclaimer in the
     17  1.16  wrstuden  *    documentation and/or other materials provided with the distribution.
     18  1.17     soren  * 3. Neither the name of the National Aeronautics & Space Administration
     19  1.16  wrstuden  *    nor the names of its contributors may be used to endorse or promote
     20  1.16  wrstuden  *    products derived from this software without specific prior written
     21  1.16  wrstuden  *    permission.
     22  1.16  wrstuden  *
     23  1.16  wrstuden  * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
     24  1.16  wrstuden  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     25  1.16  wrstuden  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     26  1.16  wrstuden  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
     27  1.16  wrstuden  * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     28  1.16  wrstuden  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29  1.16  wrstuden  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30  1.16  wrstuden  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31  1.16  wrstuden  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32  1.16  wrstuden  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33  1.16  wrstuden  * POSSIBILITY OF SUCH DAMAGE.
     34  1.16  wrstuden  */
     35  1.35     rmind 
     36  1.16  wrstuden /*
     37   1.1   mycroft  * Copyright (c) 1992, 1993
     38   1.1   mycroft  *	The Regents of the University of California.  All rights reserved.
     39   1.1   mycroft  *
     40   1.1   mycroft  * This code is derived from software contributed to Berkeley by
     41   1.1   mycroft  * John Heidemann of the UCLA Ficus project.
     42   1.1   mycroft  *
     43   1.1   mycroft  * Redistribution and use in source and binary forms, with or without
     44   1.1   mycroft  * modification, are permitted provided that the following conditions
     45   1.1   mycroft  * are met:
     46   1.1   mycroft  * 1. Redistributions of source code must retain the above copyright
     47   1.1   mycroft  *    notice, this list of conditions and the following disclaimer.
     48   1.1   mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     49   1.1   mycroft  *    notice, this list of conditions and the following disclaimer in the
     50   1.1   mycroft  *    documentation and/or other materials provided with the distribution.
     51  1.27       agc  * 3. Neither the name of the University nor the names of its contributors
     52   1.1   mycroft  *    may be used to endorse or promote products derived from this software
     53   1.1   mycroft  *    without specific prior written permission.
     54   1.1   mycroft  *
     55   1.1   mycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     56   1.1   mycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     57   1.1   mycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     58   1.1   mycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     59   1.1   mycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     60   1.1   mycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     61   1.1   mycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     62   1.1   mycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     63   1.1   mycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     64   1.1   mycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     65   1.1   mycroft  * SUCH DAMAGE.
     66   1.1   mycroft  *
     67  1.13      fvdl  *	@(#)null_vnops.c	8.6 (Berkeley) 5/27/95
     68   1.1   mycroft  *
     69   1.1   mycroft  * Ancestors:
     70   1.1   mycroft  *	@(#)lofs_vnops.c	1.2 (Berkeley) 6/18/92
     71  1.32     perry  *      Id: lofs_vnops.c,v 1.11 1992/05/30 10:05:43 jsp Exp jsp
     72   1.1   mycroft  *	...and...
     73   1.1   mycroft  *	@(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
     74   1.1   mycroft  */
     75   1.1   mycroft 
     76   1.1   mycroft /*
     77  1.35     rmind  * Null file-system.
     78   1.1   mycroft  *
     79  1.35     rmind  * Implemented using layerfs, see layer_vnops.c for a description.
     80   1.1   mycroft  */
     81  1.22     lukem 
     82  1.22     lukem #include <sys/cdefs.h>
     83  1.40   hannken __KERNEL_RCSID(0, "$NetBSD: null_vnops.c,v 1.40 2017/01/27 10:47:13 hannken Exp $");
     84   1.1   mycroft 
     85   1.1   mycroft #include <sys/param.h>
     86   1.1   mycroft #include <sys/systm.h>
     87   1.1   mycroft #include <sys/vnode.h>
     88  1.35     rmind 
     89  1.16  wrstuden #include <miscfs/genfs/genfs.h>
     90  1.35     rmind #include <miscfs/genfs/layer_extern.h>
     91   1.1   mycroft #include <miscfs/nullfs/null.h>
     92   1.1   mycroft 
     93   1.1   mycroft /*
     94  1.35     rmind  * Global VFS data structures.
     95   1.1   mycroft  */
     96  1.35     rmind 
     97  1.33   xtraeme int (**null_vnodeop_p)(void *);
     98  1.35     rmind 
     99  1.18  jdolecek const struct vnodeopv_entry_desc null_vnodeop_entries[] = {
    100  1.35     rmind 	{ &vop_default_desc,	layer_bypass },
    101   1.1   mycroft 
    102  1.35     rmind 	{ &vop_lookup_desc,	layer_lookup },
    103  1.35     rmind 	{ &vop_setattr_desc,	layer_setattr },
    104  1.35     rmind 	{ &vop_getattr_desc,	layer_getattr },
    105  1.35     rmind 	{ &vop_access_desc,	layer_access },
    106  1.35     rmind 	{ &vop_fsync_desc,	layer_fsync },
    107  1.35     rmind 	{ &vop_inactive_desc,	layer_inactive },
    108  1.35     rmind 	{ &vop_reclaim_desc,	layer_reclaim },
    109  1.39   hannken 	{ &vop_lock_desc,	layer_lock },
    110  1.35     rmind 	{ &vop_print_desc,	layer_print },
    111  1.35     rmind 	{ &vop_remove_desc,	layer_remove },
    112  1.35     rmind 	{ &vop_rename_desc,	layer_rename },
    113  1.37   hannken 	{ &vop_revoke_desc,	layer_revoke },
    114  1.35     rmind 	{ &vop_rmdir_desc,	layer_rmdir },
    115  1.35     rmind 
    116  1.35     rmind 	{ &vop_open_desc,	layer_open },	/* mount option handling */
    117  1.40   hannken 	{ &vop_close_desc,	layer_close },
    118  1.35     rmind 
    119  1.35     rmind 	{ &vop_bmap_desc,	layer_bmap },
    120  1.35     rmind 	{ &vop_getpages_desc,	layer_getpages },
    121  1.35     rmind 	{ &vop_putpages_desc,	layer_putpages },
    122   1.1   mycroft 
    123  1.24       chs 	{ NULL, NULL }
    124   1.1   mycroft };
    125  1.35     rmind 
    126  1.35     rmind const struct vnodeopv_desc null_vnodeop_opv_desc = {
    127  1.35     rmind 	&null_vnodeop_p, null_vnodeop_entries
    128  1.35     rmind };
    129