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