|
|
1.1 root 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: *
8: * Redistribution is only permitted until one year after the first shipment
9: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
10: * binary forms are permitted provided that: (1) source distributions retain
11: * this entire copyright notice and comment, and (2) distributions including
12: * binaries display the following acknowledgement: This product includes
13: * software developed by the University of California, Berkeley and its
14: * contributors'' in the documentation or other materials provided with the
15: * distribution and in all advertising materials mentioning features or use
16: * of this software. Neither the name of the University nor the names of
17: * its contributors may be used to endorse or promote products derived from
18: * this software without specific prior written permission.
19: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22: *
23: * @(#)nfsrvcache.h 7.3 (Berkeley) 6/28/90
24: */
25:
26: /*
27: * Definitions for the server recent request cache
28: */
29:
30: #define NFSRVCACHESIZ 128
31: #define NFSRCHSZ 32
32:
33: struct nfsrvcache {
34: struct nfsrvcache *rc_chain[2]; /* Hash chain links */
35: struct nfsrvcache *rc_next; /* Lru list */
36: struct nfsrvcache *rc_prev;
37: int rc_state; /* Current state of request */
38: int rc_flag; /* Flag bits */
39: struct mbuf rc_nam; /* Sockaddr of requestor */
40: u_long rc_xid; /* rpc id number */
41: int rc_proc; /* rpc proc number */
42: long rc_timestamp; /* Time stamp */
43: union {
44: struct mbuf *rc_repmb; /* Reply mbuf list OR */
45: int rc_repstat; /* Reply status */
46: } rc_un;
47: };
48:
49: #define rc_forw rc_chain[0]
50: #define rc_back rc_chain[1]
51: #define rc_status rc_un.rc_repstat
52: #define rc_reply rc_un.rc_repmb
53:
54: #define put_at_head(rp) \
55: (rp)->rc_prev->rc_next = (rp)->rc_next; \
56: (rp)->rc_next->rc_prev = (rp)->rc_prev; \
57: (rp)->rc_next = nfsrvcachehead.rc_next; \
58: (rp)->rc_next->rc_prev = (rp); \
59: nfsrvcachehead.rc_next = (rp); \
60: (rp)->rc_prev = &nfsrvcachehead
61:
62: /* Cache entry states */
63: #define RC_UNUSED 0
64: #define RC_INPROG 1
65: #define RC_DONE 2
66:
67: /* Return values */
68: #define RC_DROPIT 0
69: #define RC_REPLY 1
70: #define RC_DOIT 2
71:
72: /* Flag bits */
73: #define RC_LOCKED 0x1
74: #define RC_WANTED 0x2
75: #define RC_REPSTATUS 0x4
76: #define RC_REPMBUF 0x8
77:
78: /* Delay time after completion that request is dropped */
79: #define RC_DELAY 2 /* seconds */
80:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.