|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /* $NetBSD: cd9660_node.h,v 1.10 1994/12/24 15:30:09 cgd Exp $ */
26:
27: /*-
28: * Copyright (c) 1994
29: * The Regents of the University of California. All rights reserved.
30: *
31: * This code is derived from software contributed to Berkeley
32: * by Pace Willisson ([email protected]). The Rock Ridge Extension
33: * Support code is derived from software contributed to Berkeley
34: * by Atsushi Murai ([email protected]).
35: *
36: * Redistribution and use in source and binary forms, with or without
37: * modification, are permitted provided that the following conditions
38: * are met:
39: * 1. Redistributions of source code must retain the above copyright
40: * notice, this list of conditions and the following disclaimer.
41: * 2. Redistributions in binary form must reproduce the above copyright
42: * notice, this list of conditions and the following disclaimer in the
43: * documentation and/or other materials provided with the distribution.
44: * 3. All advertising materials mentioning features or use of this software
45: * must display the following acknowledgement:
46: * This product includes software developed by the University of
47: * California, Berkeley and its contributors.
48: * 4. Neither the name of the University nor the names of its contributors
49: * may be used to endorse or promote products derived from this software
50: * without specific prior written permission.
51: *
52: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62: * SUCH DAMAGE.
63: *
64: * @(#)cd9660_node.h 8.4 (Berkeley) 12/5/94
65: */
66:
67: /*
68: * Theoretically, directories can be more than 2Gb in length,
69: * however, in practice this seems unlikely. So, we define
70: * the type doff_t as a long to keep down the cost of doing
71: * lookup on a 32-bit machine. If you are porting to a 64-bit
72: * architecture, you should make doff_t the same as off_t.
73: */
74:
75: #include <sys/lock.h>
76:
77: #define doff_t long
78:
79: typedef struct {
80: struct timespec iso_atime; /* time of last access */
81: struct timespec iso_mtime; /* time of last modification */
82: struct timespec iso_ctime; /* time file changed */
83: u_short iso_mode; /* files access mode and type */
84: uid_t iso_uid; /* owner user id */
85: gid_t iso_gid; /* owner group id */
86: short iso_links; /* links of file */
87: dev_t iso_rdev; /* Major/Minor number for special */
88: } ISO_RRIP_INODE;
89:
90: #ifdef ISODEVMAP
91: /*
92: * FOr device# (major,minor) translation table
93: */
94: struct iso_dnode {
95: struct iso_dnode *d_next, **d_prev; /* hash chain */
96: dev_t i_dev; /* device where dnode resides */
97: ino_t i_number; /* the identity of the inode */
98: dev_t d_dev; /* device # for translation */
99: };
100: #endif
101:
102: struct iso_node {
103: struct iso_node *i_next, **i_prev; /* hash chain */
104: struct vnode *i_vnode; /* vnode associated with this inode */
105: struct vnode *i_devvp; /* vnode for block I/O */
106: u_long i_flag; /* see below */
107: dev_t i_dev; /* device where inode resides */
108: ino_t i_number; /* the identity of the inode */
109: /* we use the actual starting block of the file */
110: struct iso_mnt *i_mnt; /* filesystem associated with this inode */
111: struct lockf *i_lockf; /* head of byte-level lock list */
112: doff_t i_endoff; /* end of useful stuff in directory */
113: doff_t i_diroff; /* offset in dir, where we found last entry */
114: doff_t i_offset; /* offset of free space in directory */
115: ino_t i_ino; /* inode number of found directory */
116: struct lock__bsd__ i_lock; /* inode lock. */
117: long iso_extent; /* extent of file */
118: long i_size;
119: long iso_start; /* actual start of data of file (may be different */
120: /* from iso_extent, if file has extended attributes) */
121: ISO_RRIP_INODE inode;
122:
123: /* support Apple extensions to ISO directory rec */
124: u_int32_t i_FileType; /* MacOS file type - defaults to 'TEXT'*/
125: u_int32_t i_Creator; /* MacOS file creator type - defaults to 'hscd'*/
126: u_int16_t i_FinderFlags; /* MacOS finder flags - defaults to fInitedBit set */
127: ino_t i_parent; /* inode number of parent directory */
128: u_char i_name[32]; /* name of node */
129: };
130:
131: #define i_forw i_chain[0]
132: #define i_back i_chain[1]
133:
134: /* flags */
135: #define IN_ACCESS 0x0020 /* inode access time to be updated */
136:
137: #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
138: #define ITOV(ip) ((ip)->i_vnode)
139:
140: /*
141: * Prototypes for ISOFS vnode operations
142: */
143: int cd9660_lookup __P((struct vop_lookup_args *));
144: int cd9660_open __P((struct vop_open_args *));
145: int cd9660_close __P((struct vop_close_args *));
146: int cd9660_access __P((struct vop_access_args *));
147: int cd9660_getattr __P((struct vop_getattr_args *));
148: int cd9660_read __P((struct vop_read_args *));
149: int cd9660_ioctl __P((struct vop_ioctl_args *));
150: int cd9660_select __P((struct vop_select_args *));
151: int cd9660_mmap __P((struct vop_mmap_args *));
152: int cd9660_seek __P((struct vop_seek_args *));
153: int cd9660_readdir __P((struct vop_readdir_args *));
154: int cd9660_readlink __P((struct vop_readlink_args *));
155: int cd9660_abortop __P((struct vop_abortop_args *));
156: int cd9660_inactive __P((struct vop_inactive_args *));
157: int cd9660_reclaim __P((struct vop_reclaim_args *));
158: int cd9660_bmap __P((struct vop_bmap_args *));
159: int cd9660_lock __P((struct vop_lock_args *));
160: int cd9660_unlock __P((struct vop_unlock_args *));
161: int cd9660_strategy __P((struct vop_strategy_args *));
162: int cd9660_print __P((struct vop_print_args *));
163: int cd9660_islocked __P((struct vop_islocked_args *));
164: int cd9660_pathconf __P((struct vop_pathconf_args *));
165: int cd9660_blkatoff __P((struct vop_blkatoff_args *));
166:
167: void cd9660_defattr __P((struct iso_directory_record *,
168: struct iso_node *, struct buf *));
169: void cd9660_deftstamp __P((struct iso_directory_record *,
170: struct iso_node *, struct buf *));
171: struct vnode *cd9660_ihashget __P((dev_t, ino_t, struct proc *));
172: void cd9660_ihashins __P((struct iso_node *));
173: void cd9660_ihashrem __P((struct iso_node *));
174: int cd9660_tstamp_conv7 __P((u_char *, struct timespec *));
175: int cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
176: ino_t isodirino __P((struct iso_directory_record *, struct iso_mnt *));
177: #ifdef ISODEVMAP
178: struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
179: void iso_dunmap __P((dev_t));
180: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.