11541Srgrimes/*- 21541Srgrimes * Copyright (c) 1994 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * This code is derived from software contributed to Berkeley 61541Srgrimes * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 71541Srgrimes * Support code is derived from software contributed to Berkeley 81541Srgrimes * by Atsushi Murai (amurai@spec.co.jp). 91541Srgrimes * 101541Srgrimes * Redistribution and use in source and binary forms, with or without 111541Srgrimes * modification, are permitted provided that the following conditions 121541Srgrimes * are met: 131541Srgrimes * 1. Redistributions of source code must retain the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer. 151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 161541Srgrimes * notice, this list of conditions and the following disclaimer in the 171541Srgrimes * documentation and/or other materials provided with the distribution. 181541Srgrimes * 4. Neither the name of the University nor the names of its contributors 191541Srgrimes * may be used to endorse or promote products derived from this software 201541Srgrimes * without specific prior written permission. 211541Srgrimes * 221541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 231541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 261541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 271541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 281541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 291541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 301541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 311541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 321541Srgrimes * SUCH DAMAGE. 331541Srgrimes * 3422521Sdyson * @(#)cd9660_node.h 8.6 (Berkeley) 5/14/95 3550477Speter * $FreeBSD$ 361541Srgrimes */ 371541Srgrimes 381541Srgrimes/* 391541Srgrimes * Theoretically, directories can be more than 2Gb in length, 401541Srgrimes * however, in practice this seems unlikely. So, we define 411541Srgrimes * the type doff_t as a long to keep down the cost of doing 421541Srgrimes * lookup on a 32-bit machine. If you are porting to a 64-bit 431541Srgrimes * architecture, you should make doff_t the same as off_t. 441541Srgrimes */ 451541Srgrimes#define doff_t long 461541Srgrimes 471541Srgrimestypedef struct { 481541Srgrimes struct timespec iso_atime; /* time of last access */ 491541Srgrimes struct timespec iso_mtime; /* time of last modification */ 501541Srgrimes struct timespec iso_ctime; /* time file changed */ 511541Srgrimes u_short iso_mode; /* files access mode and type */ 521541Srgrimes uid_t iso_uid; /* owner user id */ 531541Srgrimes gid_t iso_gid; /* owner group id */ 541541Srgrimes short iso_links; /* links of file */ 55130640Sphk dev_t iso_rdev; /* Major/Minor number for special */ 561541Srgrimes} ISO_RRIP_INODE; 571541Srgrimes 581541Srgrimes 591541Srgrimesstruct iso_node { 601541Srgrimes struct vnode *i_vnode; /* vnode associated with this inode */ 611541Srgrimes ino_t i_number; /* the identity of the inode */ 621541Srgrimes /* we use the actual starting block of the file */ 631541Srgrimes struct iso_mnt *i_mnt; /* filesystem associated with this inode */ 641541Srgrimes struct lockf *i_lockf; /* head of byte-level lock list */ 651541Srgrimes doff_t i_endoff; /* end of useful stuff in directory */ 661541Srgrimes doff_t i_diroff; /* offset in dir, where we found last entry */ 671541Srgrimes 681541Srgrimes long iso_extent; /* extent of file */ 69165005Skientzle unsigned long i_size; 701541Srgrimes long iso_start; /* actual start of data of file (may be different */ 711541Srgrimes /* from iso_extent, if file has extended attributes) */ 725651Sjoerg ISO_RRIP_INODE inode; 731541Srgrimes}; 741541Srgrimes 751541Srgrimes#define i_forw i_chain[0] 761541Srgrimes#define i_back i_chain[1] 771541Srgrimes 781541Srgrimes#define VTOI(vp) ((struct iso_node *)(vp)->v_data) 791541Srgrimes#define ITOV(ip) ((ip)->i_vnode) 801541Srgrimes 8155206Speter#ifdef _KERNEL 8233052Sbde 8330354Sphk#ifdef MALLOC_DECLARE 8430354SphkMALLOC_DECLARE(M_ISOFSMNT); 8530354SphkMALLOC_DECLARE(M_ISOFSNODE); 8630354Sphk#endif 8730354Sphk 8833052Sbdestruct buf; 8933052Sbdestruct vop_bmap_args; 9033052Sbdestruct vop_cachedlookup_args; 9133052Sbdestruct vop_inactive_args; 9233052Sbdestruct vop_reclaim_args; 9333052Sbde 941541Srgrimes/* 951541Srgrimes * Prototypes for ISOFS vnode operations 961541Srgrimes */ 9792765Salfredint cd9660_lookup(struct vop_cachedlookup_args *); 9892765Salfredint cd9660_inactive(struct vop_inactive_args *); 9992765Salfredint cd9660_reclaim(struct vop_reclaim_args *); 10092765Salfredint cd9660_bmap(struct vop_bmap_args *); 10192765Salfredint cd9660_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp); 10222521Sdyson 10392765Salfredvoid cd9660_defattr(struct iso_directory_record *, 10492765Salfred struct iso_node *, struct buf *, enum ISO_FTYPE); 10592765Salfredvoid cd9660_deftstamp(struct iso_directory_record *, 10692765Salfred struct iso_node *, struct buf *, enum ISO_FTYPE); 10792765Salfredint cd9660_tstamp_conv7(u_char *, struct timespec *, enum ISO_FTYPE); 10892765Salfredint cd9660_tstamp_conv17(u_char *, struct timespec *); 10933052Sbde 11055206Speter#endif /* _KERNEL */ 111