home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / ufs / mfsnode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  7.0 KB  |  231 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    mfsnode.h,v $
  29.  * Revision 2.1  92/04/21  17:18:23  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*
  36.  * Copyright (c) 1989 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)mfsnode.h    7.3 (Berkeley) 4/16/91
  68.  */
  69.  
  70. /*
  71.  * This structure defines the control data for the memory
  72.  * based file system.
  73.  */
  74.  
  75. struct mfsnode {
  76.     struct    vnode *mfs_vnode;    /* vnode associated with this mfsnode */
  77.     caddr_t    mfs_baseoff;        /* base of file system in memory */
  78.     long    mfs_size;        /* size of memory file system */
  79.     pid_t    mfs_pid;        /* supporting process pid */
  80.     struct    buf *mfs_buflist;    /* list of I/O requests */
  81.     long    mfs_spare[4];
  82. };
  83.  
  84. /*
  85.  * Convert between mfsnode pointers and vnode pointers
  86.  */
  87. #define VTOMFS(vp)    ((struct mfsnode *)(vp)->v_data)
  88. #define MFSTOV(mfsp)    ((mfsp)->mfs_vnode)
  89.  
  90. /*
  91.  * Prototypes for MFS operations on vnodes.
  92.  */
  93. int    mfs_badop();
  94. #define mfs_lookup ((int (*) __P(( \
  95.         struct vnode *vp, \
  96.         struct nameidata *ndp, \
  97.         struct proc *p))) mfs_badop)
  98. #define mfs_create ((int (*) __P(( \
  99.         struct nameidata *ndp, \
  100.         struct vattr *vap, \
  101.         struct proc *p))) mfs_badop)
  102. #define mfs_mknod ((int (*) __P(( \
  103.         struct nameidata *ndp, \
  104.         struct vattr *vap, \
  105.         struct ucred *cred, \
  106.         struct proc *p))) mfs_badop)
  107. int    mfs_open __P((
  108.         struct vnode *vp,
  109.         int mode,
  110.         struct ucred *cred,
  111.         struct proc *p));
  112. int    mfs_close __P((
  113.         struct vnode *vp,
  114.         int fflag,
  115.         struct ucred *cred,
  116.         struct proc *p));
  117. #define mfs_access ((int (*) __P(( \
  118.         struct vnode *vp, \
  119.         int mode, \
  120.         struct ucred *cred, \
  121.         struct proc *p))) mfs_badop)
  122. #define mfs_getattr ((int (*) __P(( \
  123.         struct vnode *vp, \
  124.         struct vattr *vap, \
  125.         struct ucred *cred, \
  126.         struct proc *p))) mfs_badop)
  127. #define mfs_setattr ((int (*) __P(( \
  128.         struct vnode *vp, \
  129.         struct vattr *vap, \
  130.         struct ucred *cred, \
  131.         struct proc *p))) mfs_badop)
  132. #define mfs_read ((int (*) __P(( \
  133.         struct vnode *vp, \
  134.         struct uio *uio, \
  135.         int ioflag, \
  136.         struct ucred *cred))) mfs_badop)
  137. #define mfs_write ((int (*) __P(( \
  138.         struct vnode *vp, \
  139.         struct uio *uio, \
  140.         int ioflag, \
  141.         struct ucred *cred))) mfs_badop)
  142. int    mfs_ioctl __P((
  143.         struct vnode *vp,
  144.         int command,
  145.         caddr_t data,
  146.         int fflag,
  147.         struct ucred *cred,
  148.         struct proc *p));
  149. #define mfs_select ((int (*) __P(( \
  150.         struct vnode *vp, \
  151.         int which, \
  152.         int fflags, \
  153.         struct ucred *cred, \
  154.         struct proc *p))) mfs_badop)
  155. #define mfs_mmap ((int (*) __P(( \
  156.         struct vnode *vp, \
  157.         int fflags, \
  158.         struct ucred *cred, \
  159.         struct proc *p))) mfs_badop)
  160. #define mfs_fsync ((int (*) __P(( \
  161.         struct vnode *vp, \
  162.         int fflags, \
  163.         struct ucred *cred, \
  164.         int waitfor, \
  165.         struct proc *p))) mfs_badop)
  166. #define mfs_seek ((int (*) __P(( \
  167.         struct vnode *vp, \
  168.         off_t oldoff, \
  169.         off_t newoff, \
  170.         struct ucred *cred))) mfs_badop)
  171. #define mfs_remove ((int (*) __P(( \
  172.         struct nameidata *ndp, \
  173.         struct proc *p))) mfs_badop)
  174. #define mfs_link ((int (*) __P(( \
  175.         struct vnode *vp, \
  176.         struct nameidata *ndp, \
  177.         struct proc *p))) mfs_badop)
  178. #define mfs_rename ((int (*) __P(( \
  179.         struct nameidata *fndp, \
  180.         struct nameidata *tdnp, \
  181.         struct proc *p))) mfs_badop)
  182. #define mfs_mkdir ((int (*) __P(( \
  183.         struct nameidata *ndp, \
  184.         struct vattr *vap, \
  185.         struct proc *p))) mfs_badop)
  186. #define mfs_rmdir ((int (*) __P(( \
  187.         struct nameidata *ndp, \
  188.         struct proc *p))) mfs_badop)
  189. #define mfs_symlink ((int (*) __P(( \
  190.         struct nameidata *ndp, \
  191.         struct vattr *vap, \
  192.         char *target, \
  193.         struct proc *p))) mfs_badop)
  194. #define mfs_readdir ((int (*) __P(( \
  195.         struct vnode *vp, \
  196.         struct uio *uio, \
  197.         struct ucred *cred, \
  198.         int *eofflagp))) mfs_badop)
  199. #define mfs_readlink ((int (*) __P(( \
  200.         struct vnode *vp, \
  201.         struct uio *uio, \
  202.         struct ucred *cred))) mfs_badop)
  203. #define mfs_abortop ((int (*) __P(( \
  204.         struct nameidata *ndp))) mfs_badop)
  205. int    mfs_inactive __P((
  206.         struct vnode *vp,
  207.         struct proc *p));
  208. #define mfs_reclaim ((int (*) __P(( \
  209.         struct vnode *vp))) nullop)
  210. #define mfs_lock ((int (*) __P(( \
  211.         struct vnode *vp))) nullop)
  212. #define mfs_unlock ((int (*) __P(( \
  213.         struct vnode *vp))) nullop)
  214. int    mfs_bmap __P((
  215.         struct vnode *vp,
  216.         daddr_t bn,
  217.         struct vnode **vpp,
  218.         daddr_t *bnp));
  219. int    mfs_strategy __P((
  220.         struct buf *bp));
  221. int    mfs_print __P((
  222.         struct vnode *vp));
  223. #define mfs_islocked ((int (*) __P(( \
  224.         struct vnode *vp))) nullop)
  225. #define mfs_advlock ((int (*) __P(( \
  226.         struct vnode *vp, \
  227.         caddr_t id, \
  228.         int op, \
  229.         struct flock *fl, \
  230.         int flags))) mfs_badop)
  231.