Annotation of src/sys/filecorefs/filecore_node.h, Revision 1.4
1.4 ! chs 1: /* $NetBSD: filecore_node.h,v 1.3 1999/07/08 01:06:00 wrstuden Exp $ */
1.1 mark 2:
3: /*-
4: * Copyright (c) 1998 Andrew McMurry
5: * Copyright (c) 1994 The Regents of the University of California.
6: * All rights reserved.
7: *
8: * Redistribution and use in source and binary forms, with or without
9: * modification, are permitted provided that the following conditions
10: * are met:
11: * 1. Redistributions of source code must retain the above copyright
12: * notice, this list of conditions and the following disclaimer.
13: * 2. Redistributions in binary form must reproduce the above copyright
14: * notice, this list of conditions and the following disclaimer in the
15: * documentation and/or other materials provided with the distribution.
16: * 3. All advertising materials mentioning features or use of this software
17: * must display the following acknowledgement:
18: * This product includes software developed by the University of
19: * California, Berkeley and its contributors.
20: * 4. Neither the name of the University nor the names of its contributors
21: * may be used to endorse or promote products derived from this software
22: * without specific prior written permission.
23: *
24: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34: * SUCH DAMAGE.
35: *
36: * filecore_node.h 1.1 1998/6/26
37: */
38:
39: /*
40: * In a future format, directories may be more than 2Gb in length,
41: * however, in practice this seems unlikely. So, we define
42: * the type doff_t as a long to keep down the cost of doing
43: * lookup on a 32-bit machine. If you are porting to a 64-bit
44: * architecture, you should make doff_t the same as off_t.
45: */
46: #define doff_t long
47:
48: struct filecore_node {
49: struct filecore_node *i_next, **i_prev; /* hash chain */
50: struct vnode *i_vnode; /* vnode associated with this inode */
51: struct vnode *i_devvp; /* vnode for block I/O */
52: u_long i_flag; /* see below */
53: dev_t i_dev; /* device where inode resides */
54: ino_t i_number; /* the identity of the inode */
55: daddr_t i_block; /* the disc address of the file */
56: ino_t i_parent; /* the ino of the file's parent */
57:
58: struct filecore_mnt *i_mnt; /* filesystem associated with this inode */
59: struct lockf *i_lockf; /* head of byte-level lock list */
1.2 mark 60: int i_diroff; /* offset in dir, where we found last entry */
1.1 mark 61:
1.2 mark 62: struct filecore_direntry i_dirent; /* directory entry */
1.1 mark 63: };
64:
65: #define i_forw i_chain[0]
66: #define i_back i_chain[1]
67: #define i_size i_dirent.len
68:
69: /* flags */
70: #define IN_ACCESS 0x0020 /* inode access time to be updated */
71:
72: #define VTOI(vp) ((struct filecore_node *)(vp)->v_data)
73: #define ITOV(ip) ((ip)->i_vnode)
74:
75: #define filecore_staleinode(ip) ((ip)->i_dirent.name[0]==0)
76:
77: /*
78: * Prototypes for Filecore vnode operations
79: */
1.4 ! chs 80: int filecore_lookup __P((void *));
! 81: #define filecore_open genfs_nullop
! 82: #define filecore_close genfs_nullop
! 83: int filecore_access __P((void *));
1.1 mark 84: int filecore_getattr __P((void *));
1.4 ! chs 85: int filecore_read __P((void *));
! 86: #define filecore_poll genfs_poll
! 87: #define filecore_mmap genfs_mmap
! 88: #define filecore_seek genfs_seek
1.1 mark 89: int filecore_readdir __P((void *));
90: int filecore_readlink __P((void *));
91: #define filecore_abortop genfs_abortop
92: int filecore_inactive __P((void *));
93: int filecore_reclaim __P((void *));
1.4 ! chs 94: int filecore_link __P((void *));
1.1 mark 95: int filecore_symlink __P((void *));
1.4 ! chs 96: int filecore_bmap __P((void *));
1.1 mark 97: int filecore_strategy __P((void *));
1.4 ! chs 98: int filecore_print __P((void *));
1.1 mark 99: int filecore_pathconf __P((void *));
100: int filecore_blkatoff __P((void *));
101:
102: struct vnode *filecore_ihashget __P((dev_t, ino_t));
103: void filecore_ihashins __P((struct filecore_node *));
104: void filecore_ihashrem __P((struct filecore_node *));
105:
106: mode_t filecore_mode __P((struct filecore_node *));
107: struct timespec filecore_time __P((struct filecore_node *));
108: ino_t filecore_getparent __P((struct filecore_node *));
109: int filecore_fn2unix __P((char *, char *, u_int8_t *));
110: int filecore_fncmp __P((const char *, const char *, u_short));
111: int filecore_dbread __P((struct filecore_node *, struct buf **));
CVSweb <webmaster@jp.NetBSD.org>