more-or-less working with new proc & user structs
[unix-history] / usr / src / sys / nfs / nfsnode.h
CommitLineData
a2907882
KM
1/*
2 * Copyright (c) 1989 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
dbf0c423 8 * %sccs.include.redist.c%
a2907882 9 *
dbf0c423 10 * @(#)nfsnode.h 7.11 (Berkeley) %G%
a2907882
KM
11 */
12
13/*
14 * The nfsnode is the nfs equivalent to ufs's inode. Any similarity
15 * is purely coincidental.
16 * There is a unique nfsnode allocated for each active file,
17 * each current directory, each mounted-on file, text file, and the root.
18 * An nfsnode is 'named' by its file handle. (nget/nfs_node.c)
19 */
20
21struct nfsnode {
22 struct nfsnode *n_chain[2]; /* must be first */
23 nfsv2fh_t n_fh; /* NFS File Handle */
24 long n_flag; /* Flag for locking.. */
3c5a3f37 25 struct vnode *n_vnode; /* vnode associated with this nfsnode */
e49b1a6c 26 time_t n_attrstamp; /* Time stamp (sec) for attributes */
a2907882
KM
27 struct vattr n_vattr; /* Vnode attribute cache */
28 struct sillyrename *n_sillyrename; /* Ptr to silly rename struct */
9238aa59
RM
29 u_long n_size; /* Current size of file */
30 time_t n_mtime; /* Prev modify time to maintain data cache consistency*/
c7dd831e 31 time_t n_ctime; /* Prev create time for name cache consistency*/
ffe6f482 32 int n_error; /* Save write error value */
4dae2a39
KM
33 pid_t n_lockholder; /* holder of nfsnode lock */
34 pid_t n_lockwaiter; /* most recent waiter for nfsnode lock */
e49b1a6c 35 u_long n_direofoffset; /* Dir. EOF offset cache */
a2907882
KM
36};
37
38#define n_forw n_chain[0]
39#define n_back n_chain[1]
40
41#ifdef KERNEL
a2907882
KM
42/*
43 * Convert between nfsnode pointers and vnode pointers
44 */
45#define VTONFS(vp) ((struct nfsnode *)(vp)->v_data)
3c5a3f37 46#define NFSTOV(np) ((struct vnode *)(np)->n_vnode)
a2907882
KM
47#endif
48/*
49 * Flags for n_flag
50 */
ffe6f482
KM
51#define NLOCKED 0x1 /* Lock the node for other local accesses */
52#define NWANT 0x2 /* Want above lock */
53#define NMODIFIED 0x4 /* Might have a modified buffer in bio */
f0f1cbaa 54#define NWRITEERR 0x8 /* Flag write errors so close will know */