Annotation of XNU/bsd/isofs/cd9660/cd9660_node.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * The contents of this file constitute Original Code as defined in and
                      7:  * are subject to the Apple Public Source License Version 1.1 (the
                      8:  * "License").  You may not use this file except in compliance with the
                      9:  * License.  Please obtain a copy of the License at
                     10:  * http://www.apple.com/publicsource and read it before using this file.
                     11:  * 
                     12:  * This Original Code and all software distributed under the License are
                     13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     17:  * License for the specific language governing rights and limitations
                     18:  * under the License.
                     19:  * 
                     20:  * @APPLE_LICENSE_HEADER_END@
                     21:  */
                     22: /*     $NetBSD: cd9660_node.h,v 1.10 1994/12/24 15:30:09 cgd Exp $     */
                     23: 
                     24: /*-
                     25:  * Copyright (c) 1994
                     26:  *     The Regents of the University of California.  All rights reserved.
                     27:  *
                     28:  * This code is derived from software contributed to Berkeley
                     29:  * by Pace Willisson ([email protected]).  The Rock Ridge Extension
                     30:  * Support code is derived from software contributed to Berkeley
                     31:  * by Atsushi Murai ([email protected]).
                     32:  *
                     33:  * Redistribution and use in source and binary forms, with or without
                     34:  * modification, are permitted provided that the following conditions
                     35:  * are met:
                     36:  * 1. Redistributions of source code must retain the above copyright
                     37:  *    notice, this list of conditions and the following disclaimer.
                     38:  * 2. Redistributions in binary form must reproduce the above copyright
                     39:  *    notice, this list of conditions and the following disclaimer in the
                     40:  *    documentation and/or other materials provided with the distribution.
                     41:  * 3. All advertising materials mentioning features or use of this software
                     42:  *    must display the following acknowledgement:
                     43:  *     This product includes software developed by the University of
                     44:  *     California, Berkeley and its contributors.
                     45:  * 4. Neither the name of the University nor the names of its contributors
                     46:  *    may be used to endorse or promote products derived from this software
                     47:  *    without specific prior written permission.
                     48:  *
                     49:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     50:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     51:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     52:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     53:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     54:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     55:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     56:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     57:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     58:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     59:  * SUCH DAMAGE.
                     60:  *
                     61:  *     @(#)cd9660_node.h       8.4 (Berkeley) 12/5/94
                     62: 
                     63: 
                     64: 
                     65:  * HISTORY
                     66:  * 22-Jan-98   radar 1669467 - ISO 9660 CD support - jwc
                     67:  * 17-Feb-98   radar 1669467 - changed lock protocol to use the lock manager -chw
                     68: 
                     69:  */
                     70: 
                     71: /*
                     72:  * Theoretically, directories can be more than 2Gb in length,
                     73:  * however, in practice this seems unlikely. So, we define
                     74:  * the type doff_t as a long to keep down the cost of doing
                     75:  * lookup on a 32-bit machine. If you are porting to a 64-bit
                     76:  * architecture, you should make doff_t the same as off_t.
                     77:  */
                     78: 
                     79: //  We're using the lock manager now so include lock.h
                     80: #include <sys/lock.h>
                     81: 
                     82: #define doff_t long
                     83: 
                     84: typedef        struct  {
                     85:        struct timespec iso_atime;      /* time of last access */
                     86:        struct timespec iso_mtime;      /* time of last modification */
                     87:        struct timespec iso_ctime;      /* time file changed */
                     88:        u_short         iso_mode;       /* files access mode and type */
                     89:        uid_t           iso_uid;        /* owner user id */
                     90:        gid_t           iso_gid;        /* owner group id */
                     91:        short           iso_links;      /* links of file */
                     92:        dev_t           iso_rdev;       /* Major/Minor number for special */
                     93: } ISO_RRIP_INODE;
                     94: 
                     95: #ifdef ISODEVMAP
                     96: /*
                     97:  * FOr device# (major,minor) translation table
                     98:  */
                     99: struct iso_dnode {
                    100:        struct iso_dnode *d_next, **d_prev;     /* hash chain */
                    101:        dev_t           i_dev;          /* device where dnode resides */
                    102:        ino_t           i_number;       /* the identity of the inode */
                    103:        dev_t           d_dev;          /* device # for translation */
                    104: };
                    105: #endif
                    106: 
                    107: struct iso_node {
                    108:        struct  iso_node *i_next, **i_prev;     /* hash chain */
                    109:        struct  vnode *i_vnode; /* vnode associated with this inode */
                    110:        struct  vnode *i_devvp; /* vnode for block I/O */
                    111:        u_long  i_flag;         /* see below */
                    112:        dev_t   i_dev;          /* device where inode resides */
                    113:        ino_t   i_number;       /* the identity of the inode */
                    114:                                /* we use the actual starting block of the file */
                    115:        struct  iso_mnt *i_mnt; /* filesystem associated with this inode */
                    116:        struct  lockf *i_lockf; /* head of byte-level lock list */
                    117:        doff_t  i_endoff;       /* end of useful stuff in directory */
                    118:        doff_t  i_diroff;       /* offset in dir, where we found last entry */
                    119:        doff_t  i_offset;       /* offset of free space in directory */
                    120:        ino_t   i_ino;          /* inode number of found directory */
                    121: 
                    122: // radar 1669467  Kill the lockwaiter pid and add an i_lock structure for
                    123: //               the lock manager.  Killing the lockwaiter will help me find
                    124: //               places where I need to add lockmanager calls
                    125: 
                    126:         struct   lock__bsd__ i_lock;    /* Inode lock. */
                    127:        long iso_extent;        /* extent of file */
                    128:        long i_size;
                    129:        long iso_start;         /* actual start of data of file (may be different */
                    130:                                /* from iso_extent, if file has extended attributes) */
                    131:        ISO_RRIP_INODE  inode;
                    132:        
                    133: #if 1 // radar 1669467 - need these in order to support Apple extensions to ISO directory rec
                    134:        u_int32_t                       i_FileType;                     // MacOS file type - defaults to 'TEXT'
                    135:        u_int32_t                       i_Creator;                      // MacOS file creator type - defaults to 'hscd'
                    136:        u_int16_t                       i_FinderFlags;          // MacOS finder flags - defaults to fInitedBit set
                    137: #endif // radar 1669467
                    138:        ino_t   i_parent;               /* inode number of parent directory */
                    139:        u_char  i_name[32];             /* name of node */
                    140: };
                    141: 
                    142: #define        i_forw          i_chain[0]
                    143: #define        i_back          i_chain[1]
                    144: 
                    145: /* flags */
                    146: // radar 1669467  Kill the IN_LOCKED and IN_WANTED flags since we're now using
                    147: //               the lock manager.  Killing the flags will help me find
                    148: //               places where I need to add lockmanager calls
                    149: 
                    150: // #define     IN_LOCKED       0x0001          /* inode is locked */
                    151: // #define     IN_WANTED       0x0002          /* some process waiting on lock */
                    152: 
                    153: #define        IN_ACCESS       0x0020          /* inode access time to be updated */
                    154: 
                    155: #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
                    156: #define ITOV(ip) ((ip)->i_vnode)
                    157: 
                    158: /*
                    159:  * Prototypes for ISOFS vnode operations
                    160:  */
                    161: int cd9660_lookup __P((struct vop_lookup_args *));
                    162: int cd9660_open __P((struct vop_open_args *));
                    163: int cd9660_close __P((struct vop_close_args *));
                    164: int cd9660_access __P((struct vop_access_args *));
                    165: int cd9660_getattr __P((struct vop_getattr_args *));
                    166: int cd9660_read __P((struct vop_read_args *));
                    167: int cd9660_ioctl __P((struct vop_ioctl_args *));
                    168: int cd9660_select __P((struct vop_select_args *));
                    169: int cd9660_mmap __P((struct vop_mmap_args *));
                    170: int cd9660_seek __P((struct vop_seek_args *));
                    171: int cd9660_readdir __P((struct vop_readdir_args *));
                    172: int cd9660_readlink __P((struct vop_readlink_args *));
                    173: int cd9660_abortop __P((struct vop_abortop_args *));
                    174: int cd9660_inactive __P((struct vop_inactive_args *));
                    175: int cd9660_reclaim __P((struct vop_reclaim_args *));
                    176: int cd9660_bmap __P((struct vop_bmap_args *));
                    177: int cd9660_lock __P((struct vop_lock_args *));
                    178: int cd9660_unlock __P((struct vop_unlock_args *));
                    179: int cd9660_strategy __P((struct vop_strategy_args *));
                    180: int cd9660_print __P((struct vop_print_args *));
                    181: int cd9660_islocked __P((struct vop_islocked_args *));
                    182: int cd9660_pathconf __P((struct vop_pathconf_args *));
                    183: int cd9660_blkatoff __P((struct vop_blkatoff_args *));
                    184: 
                    185: void cd9660_defattr __P((struct iso_directory_record *,
                    186:                        struct iso_node *, struct buf *));
                    187: void cd9660_deftstamp __P((struct iso_directory_record *,
                    188:                        struct iso_node *, struct buf *));
                    189: struct vnode *cd9660_ihashget __P((dev_t, ino_t, struct proc *));
                    190: void cd9660_ihashins __P((struct iso_node *));
                    191: void cd9660_ihashrem __P((struct iso_node *));
                    192: int cd9660_tstamp_conv7 __P((u_char *, struct timespec *));
                    193: int cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
                    194: ino_t isodirino __P((struct iso_directory_record *, struct iso_mnt *));
                    195: #ifdef ISODEVMAP
                    196: struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
                    197: void iso_dunmap __P((dev_t));
                    198: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.