2 * This Cplant(TM) source code is the property of Sandia National
5 * This Cplant(TM) source code is copyrighted by Sandia National
8 * The redistribution of this Cplant(TM) source code is subject to the
9 * terms of the GNU Lesser General Public License
10 * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
12 * Cplant(TM) Copyright 1998-2003 Sandia Corporation.
13 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
14 * license for use of this work by or on behalf of the US Government.
15 * Export of this program may require a license from the United States
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 * Questions or comments about this library should be sent to:
37 * Sandia National Laboratories, New Mexico
39 * Albuquerque, NM 87185-1110
45 * File system or volume support.
54 * File system switch operations.
57 int (*fsswop_mount)(const char *source,
60 struct pnode *tocover,
65 * File system switch entry record.
67 * Each available file system or volume access driver is represented by
68 * one of these switch entries in the switch.
71 const char *fssw_name; /* entry name */
72 LIST_ENTRY(fsswent) fssw_link; /* link to next */
73 struct fssw_ops fssw_ops; /* operations */
77 * Init file system switch entry record.
79 #define FSSWENT_INIT(fsswent, name, ops) \
81 (fsswent)->fssw_name = (name); \
82 (fsswent)->fssw_ops = (ops); \
88 * File system operations.
91 void (*fsop_gone)(struct filesys *);
95 * Define the desired size of the file system record's inode table. This should
96 * probably be something fancy that tries to use up a system page, or the
97 * like. I'm not feeling adventurous right now though. It is prime though.
98 * That should help out the hash.
101 #define FS_ITBLSIZ 503
105 * Inode list head record.
107 LIST_HEAD(itable_entry, inode);
110 * A filesys record is maintained for each active file system or volume.
113 dev_t fs_dev; /* device ID */
114 unsigned fs_ref; /* soft ref count */
115 unsigned fs_flags; /* flags (see below) */
116 struct filesys_ops fs_ops; /* operations */
117 void *fs_private; /* driver data */
118 struct itable_entry fs_itbl[FS_ITBLSIZ]; /* inodes hash */
119 unsigned long fs_id; /* ID */
120 size_t fs_bsize; /* block size */
123 #define FS_F_RO 0x01 /* read-only */
126 * Init file system record.
128 #define FS_INIT(fs, flags, ops, private) \
131 struct itable_entry *__head; \
134 (fs)->fs_flags = (flags); \
135 (fs)->fs_ops = *(ops); \
136 (fs)->fs_private = (private); \
138 __head = (fs)->fs_itbl; \
146 * Reference file system record.
151 assert((fs)->fs_ref); \
155 * Release reference to file system record.
157 #define FS_RELE(fs) \
159 assert((fs)->fs_ref); \
160 if (!--(fs)->fs_ref) \
161 _sysio_fs_gone(fs); \
164 extern struct fsswent *_sysio_fssw_lookup(const char *name);
165 extern int _sysio_fssw_register(const char *name, struct fssw_ops *ops);
166 extern struct filesys * _sysio_fs_new(struct filesys_ops *ops,
169 extern void _sysio_fs_gone(struct filesys *fs);
170 #ifdef ZERO_SUM_MEMORY
171 extern void _sysio_fssw_shutdown(void);