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*69425Smckusick * @(#)cd9660_node.h 8.6 (Berkeley) 05/14/95 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 3567524Smckusick #ifdef ISODEVMAP 3665789Smckusick /* 3765789Smckusick * FOr device# (major,minor) translation table 3865789Smckusick */ 3965789Smckusick struct iso_dnode { 4067524Smckusick struct iso_dnode *d_next, **d_prev; /* hash chain */ 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 #endif 4665789Smckusick 4765789Smckusick struct iso_node { 4867524Smckusick struct iso_node *i_next, **i_prev; /* hash chain */ 4965789Smckusick struct vnode *i_vnode; /* vnode associated with this inode */ 5065789Smckusick struct vnode *i_devvp; /* vnode for block I/O */ 5165789Smckusick u_long i_flag; /* see below */ 5265789Smckusick dev_t i_dev; /* device where inode resides */ 5365789Smckusick ino_t i_number; /* the identity of the inode */ 5465789Smckusick /* we use the actual starting block of the file */ 5565789Smckusick struct iso_mnt *i_mnt; /* filesystem associated with this inode */ 5665789Smckusick struct lockf *i_lockf; /* head of byte-level lock list */ 5765789Smckusick doff_t i_endoff; /* end of useful stuff in directory */ 5865789Smckusick doff_t i_diroff; /* offset in dir, where we found last entry */ 5965789Smckusick doff_t i_offset; /* offset of free space in directory */ 6065789Smckusick ino_t i_ino; /* inode number of found directory */ 61*69425Smckusick struct lock i_lock; /* node lock */ 6265789Smckusick 6365789Smckusick long iso_extent; /* extent of file */ 6465789Smckusick long i_size; 6565789Smckusick long iso_start; /* actual start of data of file (may be different */ 6665789Smckusick /* from iso_extent, if file has extended attributes) */ 6765789Smckusick ISO_RRIP_INODE inode; 6865789Smckusick }; 6965789Smckusick 7065789Smckusick #define i_forw i_chain[0] 7165789Smckusick #define i_back i_chain[1] 7265789Smckusick 7365789Smckusick /* flags */ 7467524Smckusick #define IN_ACCESS 0x0020 /* inode access time to be updated */ 7565789Smckusick 7665789Smckusick #define VTOI(vp) ((struct iso_node *)(vp)->v_data) 7765789Smckusick #define ITOV(ip) ((ip)->i_vnode) 7865789Smckusick 7965789Smckusick /* 8065789Smckusick * Prototypes for ISOFS vnode operations 8165789Smckusick */ 8265855Smckusick int cd9660_lookup __P((struct vop_lookup_args *)); 8365855Smckusick int cd9660_open __P((struct vop_open_args *)); 8465855Smckusick int cd9660_close __P((struct vop_close_args *)); 8565855Smckusick int cd9660_access __P((struct vop_access_args *)); 8665855Smckusick int cd9660_getattr __P((struct vop_getattr_args *)); 8765855Smckusick int cd9660_read __P((struct vop_read_args *)); 8865855Smckusick int cd9660_ioctl __P((struct vop_ioctl_args *)); 8965855Smckusick int cd9660_select __P((struct vop_select_args *)); 9065855Smckusick int cd9660_mmap __P((struct vop_mmap_args *)); 9165855Smckusick int cd9660_seek __P((struct vop_seek_args *)); 9265855Smckusick int cd9660_readdir __P((struct vop_readdir_args *)); 9365855Smckusick int cd9660_abortop __P((struct vop_abortop_args *)); 9465855Smckusick int cd9660_inactive __P((struct vop_inactive_args *)); 9565855Smckusick int cd9660_reclaim __P((struct vop_reclaim_args *)); 9665855Smckusick int cd9660_bmap __P((struct vop_bmap_args *)); 9765855Smckusick int cd9660_lock __P((struct vop_lock_args *)); 9865855Smckusick int cd9660_unlock __P((struct vop_unlock_args *)); 9965855Smckusick int cd9660_strategy __P((struct vop_strategy_args *)); 10065855Smckusick int cd9660_print __P((struct vop_print_args *)); 10165855Smckusick int cd9660_islocked __P((struct vop_islocked_args *)); 10268044Smckusick int cd9660_pathconf __P((struct vop_pathconf_args *)); 10368044Smckusick int cd9660_blkatoff __P((struct vop_blkatoff_args *)); 10468417Smckusick #define cd9660_revoke vop_revoke 10568044Smckusick 10665855Smckusick void cd9660_defattr __P((struct iso_directory_record *, 10765789Smckusick struct iso_node *, struct buf *)); 10865855Smckusick void cd9660_deftstamp __P((struct iso_directory_record *, 10965789Smckusick struct iso_node *, struct buf *)); 11067524Smckusick struct vnode *cd9660_ihashget __P((dev_t, ino_t)); 11167524Smckusick void cd9660_ihashins __P((struct iso_node *)); 11267524Smckusick void cd9660_ihashrem __P((struct iso_node *)); 11368044Smckusick int cd9660_tstamp_conv7 __P((u_char *, struct timespec *)); 11468044Smckusick int cd9660_tstamp_conv17 __P((u_char *, struct timespec *)); 11568044Smckusick ino_t isodirino __P((struct iso_directory_record *, struct iso_mnt *)); 11665789Smckusick #ifdef ISODEVMAP 11765789Smckusick struct iso_dnode *iso_dmap __P((dev_t, ino_t, int)); 11865789Smckusick void iso_dunmap __P((dev_t)); 11965789Smckusick #endif 120