/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 19944* The Regents of the University of California. All rights reserved.5*6* This code is derived from software contributed to Berkeley7* by Pace Willisson ([email protected]). The Rock Ridge Extension8* Support code is derived from software contributed to Berkeley9* by Atsushi Murai ([email protected]).10*11* Redistribution and use in source and binary forms, with or without12* modification, are permitted provided that the following conditions13* are met:14* 1. Redistributions of source code must retain the above copyright15* notice, this list of conditions and the following disclaimer.16* 2. Redistributions in binary form must reproduce the above copyright17* notice, this list of conditions and the following disclaimer in the18* documentation and/or other materials provided with the distribution.19* 3. Neither the name of the University nor the names of its contributors20* may be used to endorse or promote products derived from this software21* without specific prior written permission.22*23* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND24* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE25* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE26* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE27* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL28* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS29* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)30* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT31* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY32* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF33* SUCH DAMAGE.34*/3536/*37* Theoretically, directories can be more than 2Gb in length,38* however, in practice this seems unlikely. So, we define39* the type doff_t as a long to keep down the cost of doing40* lookup on a 32-bit machine. If you are porting to a 64-bit41* architecture, you should make doff_t the same as off_t.42*/43#define doff_t long4445typedef struct {46struct timespec iso_atime; /* time of last access */47struct timespec iso_mtime; /* time of last modification */48struct timespec iso_ctime; /* time file changed */49u_short iso_mode; /* files access mode and type */50uid_t iso_uid; /* owner user id */51gid_t iso_gid; /* owner group id */52short iso_links; /* links of file */53dev_t iso_rdev; /* Major/Minor number for special */54} ISO_RRIP_INODE;5556struct iso_node {57struct vnode *i_vnode; /* vnode associated with this inode */58ino_t i_number; /* the identity of the inode */59/* we use the actual starting block of the file */60struct iso_mnt *i_mnt; /* filesystem associated with this inode */61struct lockf *i_lockf; /* head of byte-level lock list */62doff_t i_endoff; /* end of useful stuff in directory */63doff_t i_diroff; /* offset in dir, where we found last entry */6465long iso_extent; /* extent of file */66unsigned long i_size;67long iso_start; /* actual start of data of file (may be different */68/* from iso_extent, if file has extended attributes) */69ISO_RRIP_INODE inode;70};7172#define i_forw i_chain[0]73#define i_back i_chain[1]7475#define VTOI(vp) ((struct iso_node *)(vp)->v_data)76#define ITOV(ip) ((ip)->i_vnode)7778#ifdef _KERNEL7980#ifdef MALLOC_DECLARE81MALLOC_DECLARE(M_ISOFSMNT);82MALLOC_DECLARE(M_ISOFSNODE);83#endif8485struct buf;86struct vop_bmap_args;87struct vop_cachedlookup_args;88struct vop_inactive_args;89struct vop_reclaim_args;9091/*92* Prototypes for ISOFS vnode operations93*/94int cd9660_lookup(struct vop_cachedlookup_args *);95int cd9660_inactive(struct vop_inactive_args *);96int cd9660_reclaim(struct vop_reclaim_args *);97int cd9660_bmap(struct vop_bmap_args *);98int cd9660_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp);99100void cd9660_defattr(struct iso_directory_record *,101struct iso_node *, struct buf *, enum ISO_FTYPE);102void cd9660_deftstamp(struct iso_directory_record *,103struct iso_node *, struct buf *, enum ISO_FTYPE);104int cd9660_tstamp_conv7(u_char *, struct timespec *, enum ISO_FTYPE);105int cd9660_tstamp_conv17(u_char *, struct timespec *);106107#endif /* _KERNEL */108109110