xref: /csrg-svn/sys/isofs/cd9660/cd9660_node.h (revision 65789)
1*65789Smckusick /*-
2*65789Smckusick  * Copyright (c) 1994
3*65789Smckusick  *	The Regents of the University of California.  All rights reserved.
4*65789Smckusick  *
5*65789Smckusick  * This code is derived from software contributed to Berkeley
6*65789Smckusick  * by Pace Willisson (pace@blitz.com).  The Rock Ridge Extension
7*65789Smckusick  * Support code is derived from software contributed to Berkeley
8*65789Smckusick  * by Atsushi Murai (amurai@spec.co.jp).
9*65789Smckusick  *
10*65789Smckusick  * %sccs.include.redist.c%
11*65789Smckusick  *
12*65789Smckusick  *	@(#)cd9660_node.h	8.1 (Berkeley) 01/21/94
13*65789Smckusick  */
14*65789Smckusick 
15*65789Smckusick /*
16*65789Smckusick  * Theoretically, directories can be more than 2Gb in length,
17*65789Smckusick  * however, in practice this seems unlikely. So, we define
18*65789Smckusick  * the type doff_t as a long to keep down the cost of doing
19*65789Smckusick  * lookup on a 32-bit machine. If you are porting to a 64-bit
20*65789Smckusick  * architecture, you should make doff_t the same as off_t.
21*65789Smckusick  */
22*65789Smckusick #define doff_t	long
23*65789Smckusick 
24*65789Smckusick typedef	struct	{
25*65789Smckusick 	struct timespec	iso_atime;	/* time of last access */
26*65789Smckusick 	struct timespec	iso_mtime;	/* time of last modification */
27*65789Smckusick 	struct timespec	iso_ctime;	/* time file changed */
28*65789Smckusick 	u_short		iso_mode;	/* files access mode and type */
29*65789Smckusick 	uid_t		iso_uid;	/* owner user id */
30*65789Smckusick 	gid_t		iso_gid;	/* owner group id */
31*65789Smckusick 	short		iso_links;	/* links of file */
32*65789Smckusick 	dev_t		iso_rdev;	/* Major/Minor number for special */
33*65789Smckusick } ISO_RRIP_INODE;
34*65789Smckusick 
35*65789Smckusick #ifdef	ISODEVMAP
36*65789Smckusick /*
37*65789Smckusick  * FOr device# (major,minor) translation table
38*65789Smckusick  */
39*65789Smckusick struct iso_dnode {
40*65789Smckusick 	struct iso_dnode *d_chain[2];	/* hash chain, MUST be first */
41*65789Smckusick 	dev_t		i_dev;		/* device where dnode resides */
42*65789Smckusick 	ino_t		i_number;	/* the identity of the inode */
43*65789Smckusick 	dev_t		d_dev;		/* device # for translation */
44*65789Smckusick };
45*65789Smckusick #define	d_forw		d_chain[0]
46*65789Smckusick #define	d_back		d_chain[1]
47*65789Smckusick #endif
48*65789Smckusick 
49*65789Smckusick struct iso_node {
50*65789Smckusick 	struct	iso_node *i_chain[2]; /* hash chain, MUST be first */
51*65789Smckusick 	struct	vnode *i_vnode;	/* vnode associated with this inode */
52*65789Smckusick 	struct	vnode *i_devvp;	/* vnode for block I/O */
53*65789Smckusick 	u_long	i_flag;		/* see below */
54*65789Smckusick 	dev_t	i_dev;		/* device where inode resides */
55*65789Smckusick 	ino_t	i_number;	/* the identity of the inode */
56*65789Smckusick 				/* we use the actual starting block of the file */
57*65789Smckusick 	struct	iso_mnt *i_mnt;	/* filesystem associated with this inode */
58*65789Smckusick 	struct	lockf *i_lockf;	/* head of byte-level lock list */
59*65789Smckusick 	doff_t	i_endoff;	/* end of useful stuff in directory */
60*65789Smckusick 	doff_t	i_diroff;	/* offset in dir, where we found last entry */
61*65789Smckusick 	doff_t	i_offset;	/* offset of free space in directory */
62*65789Smckusick 	ino_t	i_ino;		/* inode number of found directory */
63*65789Smckusick 	long	i_spare0;
64*65789Smckusick 	long	i_spare1;
65*65789Smckusick 
66*65789Smckusick 	long iso_extent;	/* extent of file */
67*65789Smckusick 	long i_size;
68*65789Smckusick 	long iso_start;		/* actual start of data of file (may be different */
69*65789Smckusick 				/* from iso_extent, if file has extended attributes) */
70*65789Smckusick 	ISO_RRIP_INODE  inode;
71*65789Smckusick };
72*65789Smckusick 
73*65789Smckusick #define	i_forw		i_chain[0]
74*65789Smckusick #define	i_back		i_chain[1]
75*65789Smckusick 
76*65789Smckusick /* flags */
77*65789Smckusick #define	ILOCKED		0x0001		/* inode is locked */
78*65789Smckusick #define	IWANT		0x0002		/* some process waiting on lock */
79*65789Smckusick #define	IACC		0x0020		/* inode access time to be updated */
80*65789Smckusick 
81*65789Smckusick #define VTOI(vp) ((struct iso_node *)(vp)->v_data)
82*65789Smckusick #define ITOV(ip) ((ip)->i_vnode)
83*65789Smckusick 
84*65789Smckusick #define ISO_ILOCK(ip)	iso_ilock(ip)
85*65789Smckusick #define ISO_IUNLOCK(ip)	iso_iunlock(ip)
86*65789Smckusick 
87*65789Smckusick /*
88*65789Smckusick  * Prototypes for ISOFS vnode operations
89*65789Smckusick  */
90*65789Smckusick int isofs_lookup __P((struct vop_lookup_args *));
91*65789Smckusick int isofs_open __P((struct vop_open_args *));
92*65789Smckusick int isofs_close __P((struct vop_close_args *));
93*65789Smckusick int isofs_access __P((struct vop_access_args *));
94*65789Smckusick int isofs_getattr __P((struct vop_getattr_args *));
95*65789Smckusick int isofs_read __P((struct vop_read_args *));
96*65789Smckusick int isofs_ioctl __P((struct vop_ioctl_args *));
97*65789Smckusick int isofs_select __P((struct vop_select_args *));
98*65789Smckusick int isofs_mmap __P((struct vop_mmap_args *));
99*65789Smckusick int isofs_seek __P((struct vop_seek_args *));
100*65789Smckusick int isofs_readdir __P((struct vop_readdir_args *));
101*65789Smckusick int isofs_abortop __P((struct vop_abortop_args *));
102*65789Smckusick int isofs_inactive __P((struct vop_inactive_args *));
103*65789Smckusick int isofs_reclaim __P((struct vop_reclaim_args *));
104*65789Smckusick int isofs_bmap __P((struct vop_bmap_args *));
105*65789Smckusick int isofs_lock __P((struct vop_lock_args *));
106*65789Smckusick int isofs_unlock __P((struct vop_unlock_args *));
107*65789Smckusick int isofs_strategy __P((struct vop_strategy_args *));
108*65789Smckusick int isofs_print __P((struct vop_print_args *));
109*65789Smckusick int isofs_islocked __P((struct vop_islocked_args *));
110*65789Smckusick void isofs_defattr __P((struct iso_directory_record *,
111*65789Smckusick 			struct iso_node *, struct buf *));
112*65789Smckusick void isofs_deftstamp __P((struct iso_directory_record *,
113*65789Smckusick 			struct iso_node *, struct buf *));
114*65789Smckusick #ifdef	ISODEVMAP
115*65789Smckusick struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
116*65789Smckusick void iso_dunmap __P((dev_t));
117*65789Smckusick #endif
118