165789Smckusick /*- 265789Smckusick * Copyright (c) 1994 365789Smckusick * The Regents of the University of California. All rights reserved. 465789Smckusick * 565789Smckusick * This code is derived from software contributed to Berkeley 665789Smckusick * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 765789Smckusick * Support code is derived from software contributed to Berkeley 865789Smckusick * by Atsushi Murai (amurai@spec.co.jp). 965789Smckusick * 1065789Smckusick * %sccs.include.redist.c% 1165789Smckusick * 12*65855Smckusick * @(#)cd9660_node.h 8.2 (Berkeley) 01/23/94 1365789Smckusick */ 1465789Smckusick 1565789Smckusick /* 1665789Smckusick * Theoretically, directories can be more than 2Gb in length, 1765789Smckusick * however, in practice this seems unlikely. So, we define 1865789Smckusick * the type doff_t as a long to keep down the cost of doing 1965789Smckusick * lookup on a 32-bit machine. If you are porting to a 64-bit 2065789Smckusick * architecture, you should make doff_t the same as off_t. 2165789Smckusick */ 2265789Smckusick #define doff_t long 2365789Smckusick 2465789Smckusick typedef struct { 2565789Smckusick struct timespec iso_atime; /* time of last access */ 2665789Smckusick struct timespec iso_mtime; /* time of last modification */ 2765789Smckusick struct timespec iso_ctime; /* time file changed */ 2865789Smckusick u_short iso_mode; /* files access mode and type */ 2965789Smckusick uid_t iso_uid; /* owner user id */ 3065789Smckusick gid_t iso_gid; /* owner group id */ 3165789Smckusick short iso_links; /* links of file */ 3265789Smckusick dev_t iso_rdev; /* Major/Minor number for special */ 3365789Smckusick } ISO_RRIP_INODE; 3465789Smckusick 3565789Smckusick #ifdef ISODEVMAP 3665789Smckusick /* 3765789Smckusick * FOr device# (major,minor) translation table 3865789Smckusick */ 3965789Smckusick struct iso_dnode { 4065789Smckusick struct iso_dnode *d_chain[2]; /* hash chain, MUST be first */ 4165789Smckusick dev_t i_dev; /* device where dnode resides */ 4265789Smckusick ino_t i_number; /* the identity of the inode */ 4365789Smckusick dev_t d_dev; /* device # for translation */ 4465789Smckusick }; 4565789Smckusick #define d_forw d_chain[0] 4665789Smckusick #define d_back d_chain[1] 4765789Smckusick #endif 4865789Smckusick 4965789Smckusick struct iso_node { 5065789Smckusick struct iso_node *i_chain[2]; /* hash chain, MUST be first */ 5165789Smckusick struct vnode *i_vnode; /* vnode associated with this inode */ 5265789Smckusick struct vnode *i_devvp; /* vnode for block I/O */ 5365789Smckusick u_long i_flag; /* see below */ 5465789Smckusick dev_t i_dev; /* device where inode resides */ 5565789Smckusick ino_t i_number; /* the identity of the inode */ 5665789Smckusick /* we use the actual starting block of the file */ 5765789Smckusick struct iso_mnt *i_mnt; /* filesystem associated with this inode */ 5865789Smckusick struct lockf *i_lockf; /* head of byte-level lock list */ 5965789Smckusick doff_t i_endoff; /* end of useful stuff in directory */ 6065789Smckusick doff_t i_diroff; /* offset in dir, where we found last entry */ 6165789Smckusick doff_t i_offset; /* offset of free space in directory */ 6265789Smckusick ino_t i_ino; /* inode number of found directory */ 6365789Smckusick long i_spare0; 6465789Smckusick long i_spare1; 6565789Smckusick 6665789Smckusick long iso_extent; /* extent of file */ 6765789Smckusick long i_size; 6865789Smckusick long iso_start; /* actual start of data of file (may be different */ 6965789Smckusick /* from iso_extent, if file has extended attributes) */ 7065789Smckusick ISO_RRIP_INODE inode; 7165789Smckusick }; 7265789Smckusick 7365789Smckusick #define i_forw i_chain[0] 7465789Smckusick #define i_back i_chain[1] 7565789Smckusick 7665789Smckusick /* flags */ 7765789Smckusick #define ILOCKED 0x0001 /* inode is locked */ 7865789Smckusick #define IWANT 0x0002 /* some process waiting on lock */ 7965789Smckusick #define IACC 0x0020 /* inode access time to be updated */ 8065789Smckusick 8165789Smckusick #define VTOI(vp) ((struct iso_node *)(vp)->v_data) 8265789Smckusick #define ITOV(ip) ((ip)->i_vnode) 8365789Smckusick 8465789Smckusick #define ISO_ILOCK(ip) iso_ilock(ip) 8565789Smckusick #define ISO_IUNLOCK(ip) iso_iunlock(ip) 8665789Smckusick 8765789Smckusick /* 8865789Smckusick * Prototypes for ISOFS vnode operations 8965789Smckusick */ 90*65855Smckusick int cd9660_lookup __P((struct vop_lookup_args *)); 91*65855Smckusick int cd9660_open __P((struct vop_open_args *)); 92*65855Smckusick int cd9660_close __P((struct vop_close_args *)); 93*65855Smckusick int cd9660_access __P((struct vop_access_args *)); 94*65855Smckusick int cd9660_getattr __P((struct vop_getattr_args *)); 95*65855Smckusick int cd9660_read __P((struct vop_read_args *)); 96*65855Smckusick int cd9660_ioctl __P((struct vop_ioctl_args *)); 97*65855Smckusick int cd9660_select __P((struct vop_select_args *)); 98*65855Smckusick int cd9660_mmap __P((struct vop_mmap_args *)); 99*65855Smckusick int cd9660_seek __P((struct vop_seek_args *)); 100*65855Smckusick int cd9660_readdir __P((struct vop_readdir_args *)); 101*65855Smckusick int cd9660_abortop __P((struct vop_abortop_args *)); 102*65855Smckusick int cd9660_inactive __P((struct vop_inactive_args *)); 103*65855Smckusick int cd9660_reclaim __P((struct vop_reclaim_args *)); 104*65855Smckusick int cd9660_bmap __P((struct vop_bmap_args *)); 105*65855Smckusick int cd9660_lock __P((struct vop_lock_args *)); 106*65855Smckusick int cd9660_unlock __P((struct vop_unlock_args *)); 107*65855Smckusick int cd9660_strategy __P((struct vop_strategy_args *)); 108*65855Smckusick int cd9660_print __P((struct vop_print_args *)); 109*65855Smckusick int cd9660_islocked __P((struct vop_islocked_args *)); 110*65855Smckusick void cd9660_defattr __P((struct iso_directory_record *, 11165789Smckusick struct iso_node *, struct buf *)); 112*65855Smckusick void cd9660_deftstamp __P((struct iso_directory_record *, 11365789Smckusick struct iso_node *, struct buf *)); 11465789Smckusick #ifdef ISODEVMAP 11565789Smckusick struct iso_dnode *iso_dmap __P((dev_t, ino_t, int)); 11665789Smckusick void iso_dunmap __P((dev_t)); 11765789Smckusick #endif 118