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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)slides.t 5.2 (Berkeley) 4/16/91
33 Encapsulation of namei parameters
35 .ta .5i +\w'caddr_t\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
37 /* arguments and context: */
41 struct vnode *ni_cdir;
42 struct vnode *ni_rdir;
43 struct ucred *ni_cred;
45 /* shared with lookup and commit: */
56 /* BEGIN UFS SPECIFIC */
58 struct vnode *nc_prevdir;
62 /* END UFS SPECIFIC */
68 Namei operations and modifiers
71 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
72 #define LOOKUP 0 /* name lookup only */
73 #define CREATE 1 /* setup for creation */
74 #define DELETE 2 /* setup for deletion */
75 #define WANTPARENT 0x10 /* return parent vnode also */
76 #define NOCACHE 0x20 /* remove name from cache */
77 #define FOLLOW 0x40 /* follow symbolic links */
81 Namei operations and modifiers
84 .ta \w'#define\0\0'u +\w'WANTPARENT\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
88 #define WANTPARENT 0x10
98 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
103 gid_t cr_groups[NGROUPS];
105 * The following either should not be here,
106 * or should be treated as opaque.
115 .ta .5i +\w'caddr_t\0\0\0'u +\w'struct\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
117 struct iovec *uio_iov;
124 enum uio_rw { UIO_READ, UIO_WRITE };
128 .ta .5i +\w'caddr_t\0\0\0'u +\w'vnode *nc_prevdir;\0\0\0\0\0'u
132 enum uio_seg iov_segflg;
137 Per-filesystem information
139 .ta .25i +\w'struct vfsops\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
141 struct vfs *vfs_next;
142 \fB+\fP struct vfs *vfs_prev;
143 struct vfsops *vfs_op;
144 struct vnode *vfs_vnodecovered;
146 \fB!\fP int vfs_fsize;
147 \fB+\fP int vfs_bsize;
148 \fB!\fP uid_t vfs_exroot;
154 .ta \w'\fB+\fP 'u +\w'#define\0\0'u +\w'VFS_EXPORTED\0\0'u +\w'0x40\0\0\0\0\0'u
156 #define VFS_RDONLY 0x01
157 \fB+\fP #define VFS_NOEXEC 0x02
158 #define VFS_MLOCK 0x04
159 #define VFS_MWAIT 0x08
160 #define VFS_NOSUID 0x10
161 #define VFS_EXPORTED 0x20
163 /* exported vfs flags: */
164 #define EX_RDONLY 0x01
169 Operations supported on virtual file system.
172 .ta .25i +\w'int\0\0'u +\w'*vfs_mountroot();\0'u
174 \fB!\fP int (*vfs_mount)(vfs, path, data, len);
175 \fB!\fP int (*vfs_unmount)(vfs, forcibly);
176 \fB+\fP int (*vfs_mountroot)();
177 int (*vfs_root)(vfs, vpp);
178 int (*vfs_statfs)(vfs, sbp);
179 \fB!\fP int (*vfs_sync)(vfs, waitfor);
180 \fB+\fP int (*vfs_fhtovp)(vfs, fhp, vpp);
181 \fB+\fP int (*vfs_vptofh)(vp, fhp);
187 Dynamic file system information
190 .ta .5i +\w'struct\0\0\0'u +\w'*vfs_vnodecovered;\0\0\0\0\0'u
192 \fB!\fP short f_type;
193 \fB+\fP short f_flags;
194 \fB!\fP long f_fsize;
195 \fB+\fP long f_bsize;
202 \fB+\fP char *f_mntonname;
203 \fB+\fP char *f_mntfromname;
207 typedef long fsid_t[2];
210 Filesystem objects (vnodes)
212 .ta .25i +\w'struct vnodeops\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
213 enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK };
220 struct vfs *v_vfsmountedhere;
222 struct vnodeops *v_op;
223 \fB+\fP struct text *v_text;
227 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0\0\0'u
240 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
242 \fB!\fP int (*vn_lookup)(ndp);
243 \fB!\fP int (*vn_create)(ndp, vap, fflags);
244 \fB+\fP int (*vn_mknod)(ndp, vap, fflags);
245 \fB!\fP int (*vn_open)(vp, fflags, cred);
246 int (*vn_close)(vp, fflags, cred);
247 int (*vn_access)(vp, fflags, cred);
248 int (*vn_getattr)(vp, vap, cred);
249 int (*vn_setattr)(vp, vap, cred);
251 \fB+\fP int (*vn_read)(vp, uiop,
253 \fB+\fP int (*vn_write)(vp, uiop,
255 \fB!\fP int (*vn_ioctl)(vp, com,
257 int (*vn_select)(vp, which, cred);
258 \fB+\fP int (*vn_mmap)(vp, ..., cred);
259 int (*vn_fsync)(vp, cred);
260 \fB+\fP int (*vn_seek)(vp, offp, off,
264 Operations on vnodes (cont)
267 .ta .25i +\w'int\0\0'u +\w'(*vn_getattr)(\0\0\0\0\0'u
269 \fB!\fP int (*vn_remove)(ndp);
270 \fB!\fP int (*vn_link)(vp, ndp);
271 \fB!\fP int (*vn_rename)(sndp, tndp);
272 \fB!\fP int (*vn_mkdir)(ndp, vap);
273 \fB!\fP int (*vn_rmdir)(ndp);
274 \fB!\fP int (*vn_symlink)(ndp, vap, nm);
275 \fB!\fP int (*vn_readdir)(vp, uiop,
277 \fB!\fP int (*vn_readlink)(vp, uiop,
280 \fB+\fP int (*vn_abortop)(ndp);
281 \fB!\fP int (*vn_inactive)(vp);
285 .ta \w'#define\0\0'u +\w'NOFOLLOW\0\0'u +\w'0x40\0\0\0\0\0'u
286 /* flags for ioflag */
288 #define IO_APPEND 0x02
296 .ta .5i +\w'struct timeval\0\0'u +\w'*v_vfsmountedhere;\0\0\0'u
300 \fB!\fP uid_t va_uid;
301 \fB!\fP gid_t va_gid;
303 \fB!\fP long va_fileid;
306 \fB+\fP u_long va_size1;
308 struct timeval va_atime;
309 struct timeval va_mtime;
310 struct timeval va_ctime;
312 \fB!\fP u_long va_bytes;
313 \fB+\fP u_long va_bytes1;