cd9660_node.h revision 1.13 1 1.13 ad /* $NetBSD: cd9660_node.h,v 1.13 2007/12/08 14:41:11 ad Exp $ */
2 1.1 jdolecek
3 1.1 jdolecek /*-
4 1.1 jdolecek * Copyright (c) 1994
5 1.1 jdolecek * The Regents of the University of California. All rights reserved.
6 1.1 jdolecek *
7 1.1 jdolecek * This code is derived from software contributed to Berkeley
8 1.1 jdolecek * by Pace Willisson (pace (at) blitz.com). The Rock Ridge Extension
9 1.1 jdolecek * Support code is derived from software contributed to Berkeley
10 1.1 jdolecek * by Atsushi Murai (amurai (at) spec.co.jp).
11 1.1 jdolecek *
12 1.1 jdolecek * Redistribution and use in source and binary forms, with or without
13 1.1 jdolecek * modification, are permitted provided that the following conditions
14 1.1 jdolecek * are met:
15 1.1 jdolecek * 1. Redistributions of source code must retain the above copyright
16 1.1 jdolecek * notice, this list of conditions and the following disclaimer.
17 1.1 jdolecek * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 jdolecek * notice, this list of conditions and the following disclaimer in the
19 1.1 jdolecek * documentation and/or other materials provided with the distribution.
20 1.5 agc * 3. Neither the name of the University nor the names of its contributors
21 1.1 jdolecek * may be used to endorse or promote products derived from this software
22 1.1 jdolecek * without specific prior written permission.
23 1.1 jdolecek *
24 1.1 jdolecek * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.1 jdolecek * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1 jdolecek * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1 jdolecek * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.1 jdolecek * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.1 jdolecek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.1 jdolecek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 jdolecek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 jdolecek * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 jdolecek * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 jdolecek * SUCH DAMAGE.
35 1.1 jdolecek *
36 1.1 jdolecek * @(#)cd9660_node.h 8.6 (Berkeley) 5/14/95
37 1.1 jdolecek */
38 1.1 jdolecek
39 1.12 christos #ifndef _ISOFS_CD9660_CD9660_NODE_H_
40 1.12 christos #define _ISOFS_CD9660_CD9660_NODE_H_
41 1.11 christos
42 1.1 jdolecek #include <miscfs/genfs/genfs_node.h>
43 1.1 jdolecek
44 1.1 jdolecek /*
45 1.1 jdolecek * Theoretically, directories can be more than 2Gb in length,
46 1.1 jdolecek * however, in practice this seems unlikely. So, we define
47 1.1 jdolecek * the type doff_t as a long to keep down the cost of doing
48 1.1 jdolecek * lookup on a 32-bit machine. If you are porting to a 64-bit
49 1.1 jdolecek * architecture, you should make doff_t the same as off_t.
50 1.1 jdolecek */
51 1.1 jdolecek #define doff_t long
52 1.1 jdolecek
53 1.1 jdolecek typedef struct {
54 1.1 jdolecek struct timespec iso_atime; /* time of last access */
55 1.1 jdolecek struct timespec iso_mtime; /* time of last modification */
56 1.1 jdolecek struct timespec iso_ctime; /* time file changed */
57 1.1 jdolecek u_short iso_mode; /* files access mode and type */
58 1.1 jdolecek uid_t iso_uid; /* owner user id */
59 1.1 jdolecek gid_t iso_gid; /* owner group id */
60 1.1 jdolecek short iso_links; /* links of file */
61 1.1 jdolecek dev_t iso_rdev; /* Major/Minor number for special */
62 1.1 jdolecek } ISO_RRIP_INODE;
63 1.1 jdolecek
64 1.1 jdolecek struct iso_node {
65 1.1 jdolecek struct genfs_node i_gnode;
66 1.1 jdolecek LIST_ENTRY(iso_node) i_hash;
67 1.1 jdolecek struct vnode *i_vnode; /* vnode associated with this inode */
68 1.1 jdolecek struct vnode *i_devvp; /* vnode for block I/O */
69 1.1 jdolecek u_long i_flag; /* see below */
70 1.1 jdolecek dev_t i_dev; /* device where inode resides */
71 1.1 jdolecek ino_t i_number; /* the identity of the inode */
72 1.1 jdolecek /* we use the actual starting block of the file */
73 1.1 jdolecek struct iso_mnt *i_mnt; /* filesystem associated with this inode */
74 1.1 jdolecek struct lockf *i_lockf; /* head of byte-level lock list */
75 1.1 jdolecek doff_t i_endoff; /* end of useful stuff in directory */
76 1.1 jdolecek doff_t i_diroff; /* offset in dir, where we found last entry */
77 1.1 jdolecek doff_t i_offset; /* offset of free space in directory */
78 1.1 jdolecek ino_t i_ino; /* inode number of found directory */
79 1.1 jdolecek
80 1.6 dillo unsigned long iso_extent; /* extent of file */
81 1.6 dillo unsigned long i_size;
82 1.6 dillo unsigned long iso_start; /* actual start of data of file (may be different */
83 1.1 jdolecek /* from iso_extent, if file has extended attributes) */
84 1.1 jdolecek ISO_RRIP_INODE inode;
85 1.1 jdolecek };
86 1.1 jdolecek
87 1.1 jdolecek #define i_forw i_chain[0]
88 1.1 jdolecek #define i_back i_chain[1]
89 1.1 jdolecek
90 1.1 jdolecek /* flags */
91 1.1 jdolecek #define IN_ACCESS 0x0020 /* inode access time to be updated */
92 1.1 jdolecek
93 1.1 jdolecek #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
94 1.1 jdolecek #define ITOV(ip) ((ip)->i_vnode)
95 1.1 jdolecek
96 1.12 christos #ifdef _KERNEL
97 1.1 jdolecek /*
98 1.1 jdolecek * Prototypes for ISOFS vnode operations
99 1.1 jdolecek */
100 1.7 xtraeme int cd9660_lookup(void *);
101 1.1 jdolecek #define cd9660_open genfs_nullop
102 1.1 jdolecek #define cd9660_close genfs_nullop
103 1.7 xtraeme int cd9660_access(void *);
104 1.7 xtraeme int cd9660_getattr(void *);
105 1.7 xtraeme int cd9660_read(void *);
106 1.1 jdolecek #define cd9660_ioctl genfs_enoioctl
107 1.1 jdolecek #define cd9660_poll genfs_poll
108 1.1 jdolecek #define cd9660_mmap genfs_mmap
109 1.1 jdolecek #define cd9660_seek genfs_seek
110 1.7 xtraeme int cd9660_readdir(void *);
111 1.7 xtraeme int cd9660_readlink(void *);
112 1.1 jdolecek #define cd9660_abortop genfs_abortop
113 1.7 xtraeme int cd9660_inactive(void *);
114 1.7 xtraeme int cd9660_reclaim(void *);
115 1.7 xtraeme int cd9660_link(void *);
116 1.7 xtraeme int cd9660_symlink(void *);
117 1.7 xtraeme int cd9660_bmap(void *);
118 1.7 xtraeme int cd9660_lock(void *);
119 1.7 xtraeme int cd9660_unlock(void *);
120 1.7 xtraeme int cd9660_strategy(void *);
121 1.7 xtraeme int cd9660_print(void *);
122 1.7 xtraeme int cd9660_islocked(void *);
123 1.8 xtraeme int cd9660_pathconf(void *);
124 1.10 yamt int cd9660_setattr(void *);
125 1.7 xtraeme
126 1.9 yamt int cd9660_blkatoff(struct vnode *, off_t, char **, struct buf **);
127 1.7 xtraeme void cd9660_defattr(struct iso_directory_record *,
128 1.7 xtraeme struct iso_node *, struct buf *);
129 1.7 xtraeme void cd9660_deftstamp(struct iso_directory_record *,
130 1.7 xtraeme struct iso_node *, struct buf *);
131 1.13 ad struct vnode *cd9660_ihashget(dev_t, ino_t, int);
132 1.7 xtraeme void cd9660_ihashins(struct iso_node *);
133 1.7 xtraeme void cd9660_ihashrem(struct iso_node *);
134 1.7 xtraeme int cd9660_tstamp_conv7(u_char *, struct timespec *);
135 1.7 xtraeme int cd9660_tstamp_conv17(u_char *, struct timespec *);
136 1.7 xtraeme int cd9660_vget_internal(struct mount *, ino_t, struct vnode **, int,
137 1.7 xtraeme struct iso_directory_record *);
138 1.13 ad
139 1.13 ad extern kmutex_t cd9660_hashlock;
140 1.13 ad
141 1.12 christos #endif /* _KERNEL */
142 1.12 christos #endif /* _ISOFS_CD9660_CD9660_NODE_H_ */
143