1 .\" $NetBSD: slides.t,v 1.2 1998/01/09 06:41:07 perry Exp $
3 .\" Copyright (c) 1986 The Regents of the University of California.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)slides.t 5.2 (Berkeley) 4/16/91
35 Encapsulation of namei parameters
37 .ta .5i +\w'caddr_t\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
39 /* arguments and context: */
43 struct vnode *ni_cdir;
44 struct vnode *ni_rdir;
45 struct ucred *ni_cred;
47 /* shared with lookup and commit: */
58 /* BEGIN UFS SPECIFIC */
60 struct vnode *nc_prevdir;
64 /* END UFS SPECIFIC */
70 Namei operations and modifiers
73 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
74 #define LOOKUP 0 /* name lookup only */
75 #define CREATE 1 /* setup for creation */
76 #define DELETE 2 /* setup for deletion */
77 #define WANTPARENT 0x10 /* return parent vnode also */
78 #define NOCACHE 0x20 /* remove name from cache */
79 #define FOLLOW 0x40 /* follow symbolic links */
83 Namei operations and modifiers
86 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
90 #define WANTPARENT 0x10
100 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
105 gid_t cr_groups[NGROUPS];
107 * The following either should not be here,
108 * or should be treated as opaque.
117 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
119 struct iovec *uio_iov;
126 enum uio_rw { UIO_READ, UIO_WRITE };
130 .ta .5i +\w'caddr_t\0\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
134 enum uio_seg iov_segflg;
139 Per-filesystem information
141 .ta .25i +\w'struct vfsops\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
143 struct vfs *vfs_next;
144 \fB+\fP struct vfs *vfs_prev;
145 struct vfsops *vfs_op;
146 struct vnode *vfs_vnodecovered;
148 \fB!\fP int vfs_fsize;
149 \fB+\fP int vfs_bsize;
150 \fB!\fP uid_t vfs_exroot;
156 .ta \w'\fB+\fP 'u +\w'#define\0\0'u +\w'VFS_EXPORTED\0\0'u +\w'0x40\0\0\0\0\0'u
158 #define VFS_RDONLY 0x01
159 \fB+\fP #define VFS_NOEXEC 0x02
160 #define VFS_MLOCK 0x04
161 #define VFS_MWAIT 0x08
162 #define VFS_NOSUID 0x10
163 #define VFS_EXPORTED 0x20
165 /* exported vfs flags: */
166 #define EX_RDONLY 0x01
171 Operations supported on virtual file system.
174 .ta .25i +\w'int\0\0'u +\w'*vfs_mountroot();\0'u
176 \fB!\fP int (*vfs_mount)(vfs, path, data, len);
177 \fB!\fP int (*vfs_unmount)(vfs, forcibly);
178 \fB+\fP int (*vfs_mountroot)();
179 int (*vfs_root)(vfs, vpp);
180 int (*vfs_statfs)(vfs, sbp);
181 \fB!\fP int (*vfs_sync)(vfs, waitfor);
182 \fB+\fP int (*vfs_fhtovp)(vfs, fhp, vpp);
183 \fB+\fP int (*vfs_vptofh)(vp, fhp);
189 Dynamic file system information
192 .ta .5i +\w'struct\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
194 \fB!\fP short f_type;
195 \fB+\fP short f_flags;
196 \fB!\fP long f_fsize;
197 \fB+\fP long f_bsize;
204 \fB+\fP char *f_mntonname;
205 \fB+\fP char *f_mntfromname;
209 typedef long fsid_t[2];
212 Filesystem objects (vnodes)
214 .ta .25i +\w'struct vnodeops\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
215 enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK };
222 struct vfs *v_vfsmountedhere;
224 struct vnodeops *v_op;
225 \fB+\fP struct text *v_text;
229 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
242 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
244 \fB!\fP int (*vn_lookup)(ndp);
245 \fB!\fP int (*vn_create)(ndp, vap, fflags);
246 \fB+\fP int (*vn_mknod)(ndp, vap, fflags);
247 \fB!\fP int (*vn_open)(vp, fflags, cred);
248 int (*vn_close)(vp, fflags, cred);
249 int (*vn_access)(vp, fflags, cred);
250 int (*vn_getattr)(vp, vap, cred);
251 int (*vn_setattr)(vp, vap, cred);
253 \fB+\fP int (*vn_read)(vp, uiop,
255 \fB+\fP int (*vn_write)(vp, uiop,
257 \fB!\fP int (*vn_ioctl)(vp, com,
259 int (*vn_select)(vp, which, cred);
260 \fB+\fP int (*vn_mmap)(vp, ..., cred);
261 int (*vn_fsync)(vp, cred);
262 \fB+\fP int (*vn_seek)(vp, offp, off,
266 Operations on vnodes (cont)
269 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
271 \fB!\fP int (*vn_remove)(ndp);
272 \fB!\fP int (*vn_link)(vp, ndp);
273 \fB!\fP int (*vn_rename)(sndp, tndp);
274 \fB!\fP int (*vn_mkdir)(ndp, vap);
275 \fB!\fP int (*vn_rmdir)(ndp);
276 \fB!\fP int (*vn_symlink)(ndp, vap, nm);
277 \fB!\fP int (*vn_readdir)(vp, uiop,
279 \fB!\fP int (*vn_readlink)(vp, uiop,
282 \fB+\fP int (*vn_abortop)(ndp);
283 \fB!\fP int (*vn_inactive)(vp);
287 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0'u
288 /* flags for ioflag */
290 #define IO_APPEND 0x02
298 .ta .5i +\w'struct timeval\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
302 \fB!\fP uid_t va_uid;
303 \fB!\fP gid_t va_gid;
305 \fB!\fP long va_fileid;
308 \fB+\fP u_long va_size1;
310 struct timeval va_atime;
311 struct timeval va_mtime;
312 struct timeval va_ctime;
314 \fB!\fP u_long va_bytes;
315 \fB+\fP u_long va_bytes1;