Deleted Added
full compact
vnode.h (31561) vnode.h (31727)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)vnode.h 8.7 (Berkeley) 2/4/94
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)vnode.h 8.7 (Berkeley) 2/4/94
34 * $Id: vnode.h,v 1.57 1997/11/22 08:35:43 bde Exp $
34 * $Id: vnode.h,v 1.58 1997/12/05 19:55:49 bde Exp $
35 */
36
37#ifndef _SYS_VNODE_H_
38#define _SYS_VNODE_H_
39
40#include <sys/queue.h>
35 */
36
37#ifndef _SYS_VNODE_H_
38#define _SYS_VNODE_H_
39
40#include <sys/queue.h>
41#include <sys/select.h> /* needed for struct selinfo in vnodes */
41
42#include <machine/lock.h>
43
44/*
45 * The vnode is the focus of all file activity in UNIX. There is a
46 * unique vnode allocated for each active file, each current directory,
47 * each mounted-on file, text file, and the root.
48 */

--- 24 unchanged lines hidden (view full) ---

73struct namecache;
74
75/*
76 * Reading or writing any of these items requires holding the appropriate lock.
77 * v_freelist is locked by the global vnode_free_list simple lock.
78 * v_mntvnodes is locked by the global mntvnodes simple lock.
79 * v_flag, v_usecount, v_holdcount and v_writecount are
80 * locked by the v_interlock simple lock.
42
43#include <machine/lock.h>
44
45/*
46 * The vnode is the focus of all file activity in UNIX. There is a
47 * unique vnode allocated for each active file, each current directory,
48 * each mounted-on file, text file, and the root.
49 */

--- 24 unchanged lines hidden (view full) ---

74struct namecache;
75
76/*
77 * Reading or writing any of these items requires holding the appropriate lock.
78 * v_freelist is locked by the global vnode_free_list simple lock.
79 * v_mntvnodes is locked by the global mntvnodes simple lock.
80 * v_flag, v_usecount, v_holdcount and v_writecount are
81 * locked by the v_interlock simple lock.
82 * v_pollinfo is locked by the lock contained inside it.
81 */
82struct vnode {
83 u_long v_flag; /* vnode flags (see below) */
84 int v_usecount; /* reference count of users */
85 int v_writecount; /* reference count of writers */
86 int v_holdcnt; /* page & buffer references */
87 daddr_t v_lastr; /* last read (read-ahead) */
88 u_long v_id; /* capability identifier */

--- 20 unchanged lines hidden (view full) ---

109 struct simplelock v_interlock; /* lock on usecount and flag */
110 struct lock *v_vnlock; /* used for non-locking fs's */
111 enum vtagtype v_tag; /* type of underlying data */
112 void *v_data; /* private data for fs */
113 LIST_HEAD(, namecache) v_cache_src; /* Cache entries from us */
114 TAILQ_HEAD(, namecache) v_cache_dst; /* Cache entries to us */
115 struct vnode *v_dd; /* .. vnode */
116 u_long v_ddid; /* .. capability identifier */
83 */
84struct vnode {
85 u_long v_flag; /* vnode flags (see below) */
86 int v_usecount; /* reference count of users */
87 int v_writecount; /* reference count of writers */
88 int v_holdcnt; /* page & buffer references */
89 daddr_t v_lastr; /* last read (read-ahead) */
90 u_long v_id; /* capability identifier */

--- 20 unchanged lines hidden (view full) ---

111 struct simplelock v_interlock; /* lock on usecount and flag */
112 struct lock *v_vnlock; /* used for non-locking fs's */
113 enum vtagtype v_tag; /* type of underlying data */
114 void *v_data; /* private data for fs */
115 LIST_HEAD(, namecache) v_cache_src; /* Cache entries from us */
116 TAILQ_HEAD(, namecache) v_cache_dst; /* Cache entries to us */
117 struct vnode *v_dd; /* .. vnode */
118 u_long v_ddid; /* .. capability identifier */
119 struct {
120 struct simplelock vpi_lock; /* lock to protect below */
121 struct selinfo vpi_selinfo; /* identity of poller(s) */
122 short vpi_events; /* what they are looking for */
123 short vpi_revents; /* what has happened */
124 } v_pollinfo;
117};
118#define v_mountedhere v_un.vu_mountedhere
119#define v_socket v_un.vu_socket
120#define v_specinfo v_un.vu_specinfo
121#define v_fifoinfo v_un.vu_fifoinfo
122
125};
126#define v_mountedhere v_un.vu_mountedhere
127#define v_socket v_un.vu_socket
128#define v_specinfo v_un.vu_specinfo
129#define v_fifoinfo v_un.vu_fifoinfo
130
131#define VN_POLLEVENT(vp, events) \
132 do { \
133 if ((vp)->v_pollinfo.vpi_events & (events)) \
134 vn_pollevent((vp), (events)); \
135 } while (0)
136
123/*
124 * Vnode flags.
125 */
126#define VROOT 0x00001 /* root of its file system */
127#define VTEXT 0x00002 /* vnode is a pure text prototype */
128#define VSYSTEM 0x00004 /* vnode being used by kernel */
129#define VISTTY 0x00008 /* vnode represents a tty */
130#define VXLOCK 0x00100 /* vnode is locked to change underlying type */

--- 337 unchanged lines hidden (view full) ---

468 struct proc *p, int slpflag, int slptimeo));
469void vprint __P((char *label, struct vnode *vp));
470int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp,
471 struct proc *p));
472int vn_close __P((struct vnode *vp,
473 int flags, struct ucred *cred, struct proc *p));
474int vn_lock __P((struct vnode *vp, int flags, struct proc *p));
475int vn_open __P((struct nameidata *ndp, int fmode, int cmode));
137/*
138 * Vnode flags.
139 */
140#define VROOT 0x00001 /* root of its file system */
141#define VTEXT 0x00002 /* vnode is a pure text prototype */
142#define VSYSTEM 0x00004 /* vnode being used by kernel */
143#define VISTTY 0x00008 /* vnode represents a tty */
144#define VXLOCK 0x00100 /* vnode is locked to change underlying type */

--- 337 unchanged lines hidden (view full) ---

482 struct proc *p, int slpflag, int slptimeo));
483void vprint __P((char *label, struct vnode *vp));
484int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp,
485 struct proc *p));
486int vn_close __P((struct vnode *vp,
487 int flags, struct ucred *cred, struct proc *p));
488int vn_lock __P((struct vnode *vp, int flags, struct proc *p));
489int vn_open __P((struct nameidata *ndp, int fmode, int cmode));
490void vn_pollevent __P((struct vnode *vp, int events));
491void vn_pollgone __P((struct vnode *vp));
492int vn_pollrecord __P((struct vnode *vp, struct proc *p, int events));
476int vn_rdwr __P((enum uio_rw rw, struct vnode *vp, caddr_t base,
477 int len, off_t offset, enum uio_seg segflg, int ioflg,
478 struct ucred *cred, int *aresid, struct proc *p));
479int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
480int vfs_cache_lookup __P((struct vop_lookup_args *ap));
481int vfs_object_create __P((struct vnode *vp, struct proc *p,
482 struct ucred *cred, int waslocked));
483int vn_writechk __P((struct vnode *vp));
484int vop_stdbwrite __P((struct vop_bwrite_args *ap));
485int vop_stdislocked __P((struct vop_islocked_args *));
486int vop_stdlock __P((struct vop_lock_args *));
487int vop_stdunlock __P((struct vop_unlock_args *));
488int vop_noislocked __P((struct vop_islocked_args *));
489int vop_nolock __P((struct vop_lock_args *));
490int vop_nopoll __P((struct vop_poll_args *));
491int vop_nounlock __P((struct vop_unlock_args *));
492int vop_stdpathconf __P((struct vop_pathconf_args *));
493int vn_rdwr __P((enum uio_rw rw, struct vnode *vp, caddr_t base,
494 int len, off_t offset, enum uio_seg segflg, int ioflg,
495 struct ucred *cred, int *aresid, struct proc *p));
496int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p));
497int vfs_cache_lookup __P((struct vop_lookup_args *ap));
498int vfs_object_create __P((struct vnode *vp, struct proc *p,
499 struct ucred *cred, int waslocked));
500int vn_writechk __P((struct vnode *vp));
501int vop_stdbwrite __P((struct vop_bwrite_args *ap));
502int vop_stdislocked __P((struct vop_islocked_args *));
503int vop_stdlock __P((struct vop_lock_args *));
504int vop_stdunlock __P((struct vop_unlock_args *));
505int vop_noislocked __P((struct vop_islocked_args *));
506int vop_nolock __P((struct vop_lock_args *));
507int vop_nopoll __P((struct vop_poll_args *));
508int vop_nounlock __P((struct vop_unlock_args *));
509int vop_stdpathconf __P((struct vop_pathconf_args *));
510int vop_stdpoll __P((struct vop_poll_args *));
493int vop_revoke __P((struct vop_revoke_args *));
494int vop_sharedlock __P((struct vop_lock_args *));
495int vop_eopnotsupp __P((struct vop_generic_args *ap));
496int vop_ebadf __P((struct vop_generic_args *ap));
497int vop_einval __P((struct vop_generic_args *ap));
498int vop_enotty __P((struct vop_generic_args *ap));
499int vop_defaultop __P((struct vop_generic_args *ap));
500int vop_null __P((struct vop_generic_args *ap));
501
502struct vnode *
503 checkalias __P((struct vnode *vp, dev_t nvp_rdev, struct mount *mp));
504void vput __P((struct vnode *vp));
505void vref __P((struct vnode *vp));
506void vrele __P((struct vnode *vp));
507
508extern vop_t **default_vnodeop_p;
509#endif /* KERNEL */
510
511#endif /* !_SYS_VNODE_H_ */
511int vop_revoke __P((struct vop_revoke_args *));
512int vop_sharedlock __P((struct vop_lock_args *));
513int vop_eopnotsupp __P((struct vop_generic_args *ap));
514int vop_ebadf __P((struct vop_generic_args *ap));
515int vop_einval __P((struct vop_generic_args *ap));
516int vop_enotty __P((struct vop_generic_args *ap));
517int vop_defaultop __P((struct vop_generic_args *ap));
518int vop_null __P((struct vop_generic_args *ap));
519
520struct vnode *
521 checkalias __P((struct vnode *vp, dev_t nvp_rdev, struct mount *mp));
522void vput __P((struct vnode *vp));
523void vref __P((struct vnode *vp));
524void vrele __P((struct vnode *vp));
525
526extern vop_t **default_vnodeop_p;
527#endif /* KERNEL */
528
529#endif /* !_SYS_VNODE_H_ */