1 .\" Copyright (c) 1986 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)slides.t 5.2 (Berkeley) 4/16/91
37 Encapsulation of namei parameters
39 .ta .5i +\w'caddr_t\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
41 /* arguments and context: */
45 struct vnode *ni_cdir;
46 struct vnode *ni_rdir;
47 struct ucred *ni_cred;
49 /* shared with lookup and commit: */
60 /* BEGIN UFS SPECIFIC */
62 struct vnode *nc_prevdir;
66 /* END UFS SPECIFIC */
72 Namei operations and modifiers
75 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
76 #define LOOKUP 0 /* name lookup only */
77 #define CREATE 1 /* setup for creation */
78 #define DELETE 2 /* setup for deletion */
79 #define WANTPARENT 0x10 /* return parent vnode also */
80 #define NOCACHE 0x20 /* remove name from cache */
81 #define FOLLOW 0x40 /* follow symbolic links */
85 Namei operations and modifiers
88 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
92 #define WANTPARENT 0x10
102 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
107 gid_t cr_groups[NGROUPS];
109 * The following either should not be here,
110 * or should be treated as opaque.
119 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
121 struct iovec *uio_iov;
128 enum uio_rw { UIO_READ, UIO_WRITE };
132 .ta .5i +\w'caddr_t\0\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
136 enum uio_seg iov_segflg;
141 Per-filesystem information
143 .ta .25i +\w'struct vfsops\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
145 struct vfs *vfs_next;
146 \fB+\fP struct vfs *vfs_prev;
147 struct vfsops *vfs_op;
148 struct vnode *vfs_vnodecovered;
150 \fB!\fP int vfs_fsize;
151 \fB+\fP int vfs_bsize;
152 \fB!\fP uid_t vfs_exroot;
158 .ta \w'\fB+\fP 'u +\w'#define\0\0'u +\w'VFS_EXPORTED\0\0'u +\w'0x40\0\0\0\0\0'u
160 #define VFS_RDONLY 0x01
161 \fB+\fP #define VFS_NOEXEC 0x02
162 #define VFS_MLOCK 0x04
163 #define VFS_MWAIT 0x08
164 #define VFS_NOSUID 0x10
165 #define VFS_EXPORTED 0x20
167 /* exported vfs flags: */
168 #define EX_RDONLY 0x01
173 Operations supported on virtual file system.
176 .ta .25i +\w'int\0\0'u +\w'*vfs_mountroot();\0'u
178 \fB!\fP int (*vfs_mount)(vfs, path, data, len);
179 \fB!\fP int (*vfs_unmount)(vfs, forcibly);
180 \fB+\fP int (*vfs_mountroot)();
181 int (*vfs_root)(vfs, vpp);
182 int (*vfs_statfs)(vfs, sbp);
183 \fB!\fP int (*vfs_sync)(vfs, waitfor);
184 \fB+\fP int (*vfs_fhtovp)(vfs, fhp, vpp);
185 \fB+\fP int (*vfs_vptofh)(vp, fhp);
191 Dynamic file system information
194 .ta .5i +\w'struct\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
196 \fB!\fP short f_type;
197 \fB+\fP short f_flags;
198 \fB!\fP long f_fsize;
199 \fB+\fP long f_bsize;
206 \fB+\fP char *f_mntonname;
207 \fB+\fP char *f_mntfromname;
211 typedef long fsid_t[2];
214 Filesystem objects (vnodes)
216 .ta .25i +\w'struct vnodeops\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
217 enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK };
224 struct vfs *v_vfsmountedhere;
226 struct vnodeops *v_op;
227 \fB+\fP struct text *v_text;
231 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
244 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
246 \fB!\fP int (*vn_lookup)(ndp);
247 \fB!\fP int (*vn_create)(ndp, vap, fflags);
248 \fB+\fP int (*vn_mknod)(ndp, vap, fflags);
249 \fB!\fP int (*vn_open)(vp, fflags, cred);
250 int (*vn_close)(vp, fflags, cred);
251 int (*vn_access)(vp, fflags, cred);
252 int (*vn_getattr)(vp, vap, cred);
253 int (*vn_setattr)(vp, vap, cred);
255 \fB+\fP int (*vn_read)(vp, uiop,
257 \fB+\fP int (*vn_write)(vp, uiop,
259 \fB!\fP int (*vn_ioctl)(vp, com,
261 int (*vn_select)(vp, which, cred);
262 \fB+\fP int (*vn_mmap)(vp, ..., cred);
263 int (*vn_fsync)(vp, cred);
264 \fB+\fP int (*vn_seek)(vp, offp, off,
268 Operations on vnodes (cont)
271 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
273 \fB!\fP int (*vn_remove)(ndp);
274 \fB!\fP int (*vn_link)(vp, ndp);
275 \fB!\fP int (*vn_rename)(sndp, tndp);
276 \fB!\fP int (*vn_mkdir)(ndp, vap);
277 \fB!\fP int (*vn_rmdir)(ndp);
278 \fB!\fP int (*vn_symlink)(ndp, vap, nm);
279 \fB!\fP int (*vn_readdir)(vp, uiop,
281 \fB!\fP int (*vn_readlink)(vp, uiop,
284 \fB+\fP int (*vn_abortop)(ndp);
285 \fB!\fP int (*vn_inactive)(vp);
289 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0'u
290 /* flags for ioflag */
292 #define IO_APPEND 0x02
300 .ta .5i +\w'struct timeval\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
304 \fB!\fP uid_t va_uid;
305 \fB!\fP gid_t va_gid;
307 \fB!\fP long va_fileid;
310 \fB+\fP u_long va_size1;
312 struct timeval va_atime;
313 struct timeval va_mtime;
314 struct timeval va_ctime;
316 \fB!\fP u_long va_bytes;
317 \fB+\fP u_long va_bytes1;