Deleted Added
full compact
cd9660_node.h (5651) cd9660_node.h (7090)
1/*-
2 * Copyright (c) 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley
6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
7 * Support code is derived from software contributed to Berkeley
8 * by Atsushi Murai (amurai@spec.co.jp).
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)cd9660_node.h 8.2 (Berkeley) 1/23/94
1/*-
2 * Copyright (c) 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley
6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
7 * Support code is derived from software contributed to Berkeley
8 * by Atsushi Murai (amurai@spec.co.jp).
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)cd9660_node.h 8.2 (Berkeley) 1/23/94
39 * $Id: cd9660_node.h,v 1.3 1994/09/15 19:46:00 bde Exp $
39 * $Id: cd9660_node.h,v 1.4 1995/01/16 17:03:25 joerg Exp $
40 */
41
42/*
43 * Theoretically, directories can be more than 2Gb in length,
44 * however, in practice this seems unlikely. So, we define
45 * the type doff_t as a long to keep down the cost of doing
46 * lookup on a 32-bit machine. If you are porting to a 64-bit
47 * architecture, you should make doff_t the same as off_t.
48 */
49#define doff_t long
50
51typedef struct {
52 struct timespec iso_atime; /* time of last access */
53 struct timespec iso_mtime; /* time of last modification */
54 struct timespec iso_ctime; /* time file changed */
55 u_short iso_mode; /* files access mode and type */
56 uid_t iso_uid; /* owner user id */
57 gid_t iso_gid; /* owner group id */
58 short iso_links; /* links of file */
59 dev_t iso_rdev; /* Major/Minor number for special */
60} ISO_RRIP_INODE;
61
62#ifdef ISODEVMAP
63/*
64 * FOr device# (major,minor) translation table
65 */
66struct iso_dnode {
67 struct iso_dnode *d_chain[2]; /* hash chain, MUST be first */
68 dev_t i_dev; /* device where dnode resides */
69 ino_t i_number; /* the identity of the inode */
70 dev_t d_dev; /* device # for translation */
71};
72#define d_forw d_chain[0]
73#define d_back d_chain[1]
74#endif
75
76struct iso_node {
77 struct iso_node *i_chain[2]; /* hash chain, MUST be first */
78 struct vnode *i_vnode; /* vnode associated with this inode */
79 struct vnode *i_devvp; /* vnode for block I/O */
80 u_long i_flag; /* see below */
81 dev_t i_dev; /* device where inode resides */
82 ino_t i_number; /* the identity of the inode */
83 /* we use the actual starting block of the file */
84 struct iso_mnt *i_mnt; /* filesystem associated with this inode */
85 struct lockf *i_lockf; /* head of byte-level lock list */
86 doff_t i_endoff; /* end of useful stuff in directory */
87 doff_t i_diroff; /* offset in dir, where we found last entry */
88 doff_t i_offset; /* offset of free space in directory */
89 ino_t i_ino; /* inode number of found directory */
90 long i_spare0;
91 long i_spare1;
92
93 long iso_extent; /* extent of file */
94 long i_size;
95 long iso_start; /* actual start of data of file (may be different */
96 /* from iso_extent, if file has extended attributes) */
97 ISO_RRIP_INODE inode;
98};
99
100#define i_forw i_chain[0]
101#define i_back i_chain[1]
102
103/* flags */
104#define ILOCKED 0x0001 /* inode is locked */
105#define IWANT 0x0002 /* some process waiting on lock */
106#define IACC 0x0020 /* inode access time to be updated */
107
108#define VTOI(vp) ((struct iso_node *)(vp)->v_data)
109#define ITOV(ip) ((ip)->i_vnode)
110
111#define ISO_ILOCK(ip) iso_ilock(ip)
112#define ISO_IUNLOCK(ip) iso_iunlock(ip)
113
40 */
41
42/*
43 * Theoretically, directories can be more than 2Gb in length,
44 * however, in practice this seems unlikely. So, we define
45 * the type doff_t as a long to keep down the cost of doing
46 * lookup on a 32-bit machine. If you are porting to a 64-bit
47 * architecture, you should make doff_t the same as off_t.
48 */
49#define doff_t long
50
51typedef struct {
52 struct timespec iso_atime; /* time of last access */
53 struct timespec iso_mtime; /* time of last modification */
54 struct timespec iso_ctime; /* time file changed */
55 u_short iso_mode; /* files access mode and type */
56 uid_t iso_uid; /* owner user id */
57 gid_t iso_gid; /* owner group id */
58 short iso_links; /* links of file */
59 dev_t iso_rdev; /* Major/Minor number for special */
60} ISO_RRIP_INODE;
61
62#ifdef ISODEVMAP
63/*
64 * FOr device# (major,minor) translation table
65 */
66struct iso_dnode {
67 struct iso_dnode *d_chain[2]; /* hash chain, MUST be first */
68 dev_t i_dev; /* device where dnode resides */
69 ino_t i_number; /* the identity of the inode */
70 dev_t d_dev; /* device # for translation */
71};
72#define d_forw d_chain[0]
73#define d_back d_chain[1]
74#endif
75
76struct iso_node {
77 struct iso_node *i_chain[2]; /* hash chain, MUST be first */
78 struct vnode *i_vnode; /* vnode associated with this inode */
79 struct vnode *i_devvp; /* vnode for block I/O */
80 u_long i_flag; /* see below */
81 dev_t i_dev; /* device where inode resides */
82 ino_t i_number; /* the identity of the inode */
83 /* we use the actual starting block of the file */
84 struct iso_mnt *i_mnt; /* filesystem associated with this inode */
85 struct lockf *i_lockf; /* head of byte-level lock list */
86 doff_t i_endoff; /* end of useful stuff in directory */
87 doff_t i_diroff; /* offset in dir, where we found last entry */
88 doff_t i_offset; /* offset of free space in directory */
89 ino_t i_ino; /* inode number of found directory */
90 long i_spare0;
91 long i_spare1;
92
93 long iso_extent; /* extent of file */
94 long i_size;
95 long iso_start; /* actual start of data of file (may be different */
96 /* from iso_extent, if file has extended attributes) */
97 ISO_RRIP_INODE inode;
98};
99
100#define i_forw i_chain[0]
101#define i_back i_chain[1]
102
103/* flags */
104#define ILOCKED 0x0001 /* inode is locked */
105#define IWANT 0x0002 /* some process waiting on lock */
106#define IACC 0x0020 /* inode access time to be updated */
107
108#define VTOI(vp) ((struct iso_node *)(vp)->v_data)
109#define ITOV(ip) ((ip)->i_vnode)
110
111#define ISO_ILOCK(ip) iso_ilock(ip)
112#define ISO_IUNLOCK(ip) iso_iunlock(ip)
113
114extern int (**cd9660_fifoop_p)();
115extern int (**cd9660_specop_p)();
116
114/*
115 * Prototypes for ISOFS vnode operations
116 */
117int cd9660_lookup __P((struct vop_lookup_args *));
118int cd9660_open __P((struct vop_open_args *));
119int cd9660_close __P((struct vop_close_args *));
120int cd9660_access __P((struct vop_access_args *));
121int cd9660_getattr __P((struct vop_getattr_args *));
122int cd9660_read __P((struct vop_read_args *));
123int cd9660_ioctl __P((struct vop_ioctl_args *));
124int cd9660_select __P((struct vop_select_args *));
125int cd9660_mmap __P((struct vop_mmap_args *));
126int cd9660_seek __P((struct vop_seek_args *));
127int cd9660_readdir __P((struct vop_readdir_args *));
128int cd9660_abortop __P((struct vop_abortop_args *));
129int cd9660_inactive __P((struct vop_inactive_args *));
130int cd9660_reclaim __P((struct vop_reclaim_args *));
131int cd9660_bmap __P((struct vop_bmap_args *));
132int cd9660_lock __P((struct vop_lock_args *));
133int cd9660_unlock __P((struct vop_unlock_args *));
134int cd9660_strategy __P((struct vop_strategy_args *));
135int cd9660_print __P((struct vop_print_args *));
136int cd9660_islocked __P((struct vop_islocked_args *));
137void cd9660_defattr __P((struct iso_directory_record *,
138 struct iso_node *, struct buf *, enum ISO_FTYPE));
139void cd9660_deftstamp __P((struct iso_directory_record *,
140 struct iso_node *, struct buf *, enum ISO_FTYPE));
141int cd9660_tstamp_conv7 __P((char *pi, struct timespec *pu, enum ISO_FTYPE));
142int cd9660_tstamp_conv17 __P((unsigned char *pi, struct timespec *pu));
143void isodirino __P((ino_t *inump, struct iso_directory_record *isodir,
144 struct iso_mnt *imp));
145#ifdef ISODEVMAP
146struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
147void iso_dunmap __P((dev_t));
148#endif
117/*
118 * Prototypes for ISOFS vnode operations
119 */
120int cd9660_lookup __P((struct vop_lookup_args *));
121int cd9660_open __P((struct vop_open_args *));
122int cd9660_close __P((struct vop_close_args *));
123int cd9660_access __P((struct vop_access_args *));
124int cd9660_getattr __P((struct vop_getattr_args *));
125int cd9660_read __P((struct vop_read_args *));
126int cd9660_ioctl __P((struct vop_ioctl_args *));
127int cd9660_select __P((struct vop_select_args *));
128int cd9660_mmap __P((struct vop_mmap_args *));
129int cd9660_seek __P((struct vop_seek_args *));
130int cd9660_readdir __P((struct vop_readdir_args *));
131int cd9660_abortop __P((struct vop_abortop_args *));
132int cd9660_inactive __P((struct vop_inactive_args *));
133int cd9660_reclaim __P((struct vop_reclaim_args *));
134int cd9660_bmap __P((struct vop_bmap_args *));
135int cd9660_lock __P((struct vop_lock_args *));
136int cd9660_unlock __P((struct vop_unlock_args *));
137int cd9660_strategy __P((struct vop_strategy_args *));
138int cd9660_print __P((struct vop_print_args *));
139int cd9660_islocked __P((struct vop_islocked_args *));
140void cd9660_defattr __P((struct iso_directory_record *,
141 struct iso_node *, struct buf *, enum ISO_FTYPE));
142void cd9660_deftstamp __P((struct iso_directory_record *,
143 struct iso_node *, struct buf *, enum ISO_FTYPE));
144int cd9660_tstamp_conv7 __P((char *pi, struct timespec *pu, enum ISO_FTYPE));
145int cd9660_tstamp_conv17 __P((unsigned char *pi, struct timespec *pu));
146void isodirino __P((ino_t *inump, struct iso_directory_record *isodir,
147 struct iso_mnt *imp));
148#ifdef ISODEVMAP
149struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
150void iso_dunmap __P((dev_t));
151#endif