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 * %sccs.include.redist.c% 9 * 10 * @(#)nfsrvcache.h 7.4 (Berkeley) 01/14/92 11 */ 12 13 /* 14 * Definitions for the server recent request cache 15 */ 16 17 #define NFSRVCACHESIZ 256 18 #define NFSRCHSZ 256 19 20 struct nfsrvcache { 21 struct nfsrvcache *rc_chain[2]; /* Hash chain links */ 22 struct nfsrvcache *rc_lchain[2]; /* Lru list */ 23 u_long rc_xid; /* rpc id number */ 24 time_t rc_timestamp; /* Time stamp */ 25 union { 26 struct mbuf *ru_repmb; /* Reply mbuf list OR */ 27 int ru_repstat; /* Reply status */ 28 } rc_un; 29 union nethostaddr rc_haddr; /* Host address */ 30 short rc_proc; /* rpc proc number */ 31 u_char rc_state; /* Current state of request */ 32 u_char rc_flag; /* Flag bits */ 33 }; 34 35 #define rc_forw rc_chain[0] 36 #define rc_back rc_chain[1] 37 #define rc_next rc_lchain[0] 38 #define rc_prev rc_lchain[1] 39 #define rc_reply rc_un.ru_repmb 40 #define rc_status rc_un.ru_repstat 41 #define rc_inetaddr rc_haddr.had_inetaddr 42 #define rc_nam rc_haddr.had_nam 43 44 /* Cache entry states */ 45 #define RC_UNUSED 0 46 #define RC_INPROG 1 47 #define RC_DONE 2 48 49 /* Return values */ 50 #define RC_DROPIT 0 51 #define RC_REPLY 1 52 #define RC_DOIT 2 53 54 /* Flag bits */ 55 #define RC_LOCKED 0x01 56 #define RC_WANTED 0x02 57 #define RC_REPSTATUS 0x04 58 #define RC_REPMBUF 0x08 59 #define RC_NQNFS 0x10 60 #define RC_INETADDR 0x20 61 #define RC_NAM 0x40 62 63 /* Delay time after completion that request is dropped */ 64 #define RC_DELAY 2 /* seconds */ 65 66