Home | History | Annotate | Line # | Download | only in cd9660
cd9660_node.h revision 1.2
      1  1.2   darrenr /*	$NetBSD: cd9660_node.h,v 1.2 2003/06/28 14:21:49 darrenr Exp $	*/
      2  1.1  jdolecek 
      3  1.1  jdolecek /*-
      4  1.1  jdolecek  * Copyright (c) 1994
      5  1.1  jdolecek  *	The Regents of the University of California.  All rights reserved.
      6  1.1  jdolecek  *
      7  1.1  jdolecek  * This code is derived from software contributed to Berkeley
      8  1.1  jdolecek  * by Pace Willisson (pace (at) blitz.com).  The Rock Ridge Extension
      9  1.1  jdolecek  * Support code is derived from software contributed to Berkeley
     10  1.1  jdolecek  * by Atsushi Murai (amurai (at) spec.co.jp).
     11  1.1  jdolecek  *
     12  1.1  jdolecek  * Redistribution and use in source and binary forms, with or without
     13  1.1  jdolecek  * modification, are permitted provided that the following conditions
     14  1.1  jdolecek  * are met:
     15  1.1  jdolecek  * 1. Redistributions of source code must retain the above copyright
     16  1.1  jdolecek  *    notice, this list of conditions and the following disclaimer.
     17  1.1  jdolecek  * 2. Redistributions in binary form must reproduce the above copyright
     18  1.1  jdolecek  *    notice, this list of conditions and the following disclaimer in the
     19  1.1  jdolecek  *    documentation and/or other materials provided with the distribution.
     20  1.1  jdolecek  * 3. All advertising materials mentioning features or use of this software
     21  1.1  jdolecek  *    must display the following acknowledgement:
     22  1.1  jdolecek  *	This product includes software developed by the University of
     23  1.1  jdolecek  *	California, Berkeley and its contributors.
     24  1.1  jdolecek  * 4. Neither the name of the University nor the names of its contributors
     25  1.1  jdolecek  *    may be used to endorse or promote products derived from this software
     26  1.1  jdolecek  *    without specific prior written permission.
     27  1.1  jdolecek  *
     28  1.1  jdolecek  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     29  1.1  jdolecek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     30  1.1  jdolecek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     31  1.1  jdolecek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     32  1.1  jdolecek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     33  1.1  jdolecek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     34  1.1  jdolecek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     35  1.1  jdolecek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     36  1.1  jdolecek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     37  1.1  jdolecek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     38  1.1  jdolecek  * SUCH DAMAGE.
     39  1.1  jdolecek  *
     40  1.1  jdolecek  *	@(#)cd9660_node.h	8.6 (Berkeley) 5/14/95
     41  1.1  jdolecek  */
     42  1.1  jdolecek 
     43  1.1  jdolecek #include <miscfs/genfs/genfs_node.h>
     44  1.1  jdolecek 
     45  1.1  jdolecek /*
     46  1.1  jdolecek  * Theoretically, directories can be more than 2Gb in length,
     47  1.1  jdolecek  * however, in practice this seems unlikely. So, we define
     48  1.1  jdolecek  * the type doff_t as a long to keep down the cost of doing
     49  1.1  jdolecek  * lookup on a 32-bit machine. If you are porting to a 64-bit
     50  1.1  jdolecek  * architecture, you should make doff_t the same as off_t.
     51  1.1  jdolecek  */
     52  1.1  jdolecek #define doff_t	long
     53  1.1  jdolecek 
     54  1.1  jdolecek typedef	struct	{
     55  1.1  jdolecek 	struct timespec	iso_atime;	/* time of last access */
     56  1.1  jdolecek 	struct timespec	iso_mtime;	/* time of last modification */
     57  1.1  jdolecek 	struct timespec	iso_ctime;	/* time file changed */
     58  1.1  jdolecek 	u_short		iso_mode;	/* files access mode and type */
     59  1.1  jdolecek 	uid_t		iso_uid;	/* owner user id */
     60  1.1  jdolecek 	gid_t		iso_gid;	/* owner group id */
     61  1.1  jdolecek 	short		iso_links;	/* links of file */
     62  1.1  jdolecek 	dev_t		iso_rdev;	/* Major/Minor number for special */
     63  1.1  jdolecek } ISO_RRIP_INODE;
     64  1.1  jdolecek 
     65  1.1  jdolecek #ifdef ISODEVMAP
     66  1.1  jdolecek /*
     67  1.1  jdolecek  * FOr device# (major,minor) translation table
     68  1.1  jdolecek  */
     69  1.1  jdolecek struct iso_dnode {
     70  1.1  jdolecek 	LIST_ENTRY(iso_dnode) d_hash;
     71  1.1  jdolecek 	dev_t		i_dev;		/* device where dnode resides */
     72  1.1  jdolecek 	ino_t		i_number;	/* the identity of the inode */
     73  1.1  jdolecek 	dev_t		d_dev;		/* device # for translation */
     74  1.1  jdolecek };
     75  1.1  jdolecek #endif
     76  1.1  jdolecek 
     77  1.1  jdolecek struct iso_node {
     78  1.1  jdolecek 	struct	genfs_node i_gnode;
     79  1.1  jdolecek 	LIST_ENTRY(iso_node) i_hash;
     80  1.1  jdolecek 	struct	vnode *i_vnode;	/* vnode associated with this inode */
     81  1.1  jdolecek 	struct	vnode *i_devvp;	/* vnode for block I/O */
     82  1.1  jdolecek 	u_long	i_flag;		/* see below */
     83  1.1  jdolecek 	dev_t	i_dev;		/* device where inode resides */
     84  1.1  jdolecek 	ino_t	i_number;	/* the identity of the inode */
     85  1.1  jdolecek 				/* we use the actual starting block of the file */
     86  1.1  jdolecek 	struct	iso_mnt *i_mnt;	/* filesystem associated with this inode */
     87  1.1  jdolecek 	struct	lockf *i_lockf;	/* head of byte-level lock list */
     88  1.1  jdolecek 	doff_t	i_endoff;	/* end of useful stuff in directory */
     89  1.1  jdolecek 	doff_t	i_diroff;	/* offset in dir, where we found last entry */
     90  1.1  jdolecek 	doff_t	i_offset;	/* offset of free space in directory */
     91  1.1  jdolecek 	ino_t	i_ino;		/* inode number of found directory */
     92  1.1  jdolecek 
     93  1.1  jdolecek 	long iso_extent;	/* extent of file */
     94  1.1  jdolecek 	long i_size;
     95  1.1  jdolecek 	long iso_start;		/* actual start of data of file (may be different */
     96  1.1  jdolecek 				/* from iso_extent, if file has extended attributes) */
     97  1.1  jdolecek 	ISO_RRIP_INODE  inode;
     98  1.1  jdolecek };
     99  1.1  jdolecek 
    100  1.1  jdolecek #define	i_forw		i_chain[0]
    101  1.1  jdolecek #define	i_back		i_chain[1]
    102  1.1  jdolecek 
    103  1.1  jdolecek /* flags */
    104  1.1  jdolecek #define	IN_ACCESS	0x0020		/* inode access time to be updated */
    105  1.1  jdolecek 
    106  1.1  jdolecek #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
    107  1.1  jdolecek #define ITOV(ip) ((ip)->i_vnode)
    108  1.1  jdolecek 
    109  1.1  jdolecek /*
    110  1.1  jdolecek  * Prototypes for ISOFS vnode operations
    111  1.1  jdolecek  */
    112  1.1  jdolecek int	cd9660_lookup	__P((void *));
    113  1.1  jdolecek #define	cd9660_open	genfs_nullop
    114  1.1  jdolecek #define	cd9660_close	genfs_nullop
    115  1.1  jdolecek int	cd9660_access	__P((void *));
    116  1.1  jdolecek int	cd9660_getattr	__P((void *));
    117  1.1  jdolecek int	cd9660_read	__P((void *));
    118  1.1  jdolecek #define	cd9660_ioctl	genfs_enoioctl
    119  1.1  jdolecek #define	cd9660_poll	genfs_poll
    120  1.1  jdolecek #define	cd9660_mmap	genfs_mmap
    121  1.1  jdolecek #define	cd9660_seek	genfs_seek
    122  1.1  jdolecek int	cd9660_readdir	__P((void *));
    123  1.1  jdolecek int	cd9660_readlink	__P((void *));
    124  1.1  jdolecek #define	cd9660_abortop	genfs_abortop
    125  1.1  jdolecek int	cd9660_inactive	__P((void *));
    126  1.1  jdolecek int	cd9660_reclaim	__P((void *));
    127  1.1  jdolecek int	cd9660_link	__P((void *));
    128  1.1  jdolecek int	cd9660_symlink	__P((void *));
    129  1.1  jdolecek int	cd9660_bmap	__P((void *));
    130  1.1  jdolecek int	cd9660_lock	__P((void *));
    131  1.1  jdolecek int	cd9660_unlock	__P((void *));
    132  1.1  jdolecek int	cd9660_strategy	__P((void *));
    133  1.1  jdolecek int	cd9660_print	__P((void *));
    134  1.1  jdolecek int	cd9660_islocked	__P((void *));
    135  1.1  jdolecek int	cd9660_pathconf	__P((void *));
    136  1.1  jdolecek int	cd9660_setattr	__P((void *));
    137  1.1  jdolecek int	cd9660_blkatoff	__P((void *));
    138  1.1  jdolecek 
    139  1.1  jdolecek void	cd9660_defattr __P((struct iso_directory_record *,
    140  1.1  jdolecek 			struct iso_node *, struct buf *));
    141  1.1  jdolecek void	cd9660_deftstamp __P((struct iso_directory_record *,
    142  1.1  jdolecek 			struct iso_node *, struct buf *));
    143  1.2   darrenr struct	vnode *cd9660_ihashget __P((dev_t, ino_t, struct lwp *));
    144  1.1  jdolecek void	cd9660_ihashins __P((struct iso_node *));
    145  1.1  jdolecek void	cd9660_ihashrem __P((struct iso_node *));
    146  1.1  jdolecek int	cd9660_tstamp_conv7 __P((u_char *, struct timespec *));
    147  1.1  jdolecek int	cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
    148  1.1  jdolecek int	cd9660_vget_internal __P((struct mount *, ino_t, struct vnode **, int,
    149  1.2   darrenr 			      struct iso_directory_record *, struct lwp *));
    150  1.1  jdolecek #ifdef	ISODEVMAP
    151  1.1  jdolecek struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
    152  1.1  jdolecek void iso_dunmap __P((dev_t));
    153  1.1  jdolecek #endif
    154