diff options
author | phk <phk@FreeBSD.org> | 1994-10-17 17:47:45 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-17 17:47:45 +0000 |
commit | 071d10f334b2e0094018c4b2027c8e3e73833bc1 (patch) | |
tree | c5905f4096b68df87a3f00435bec4fcc08408b18 /sys/nfs/nfs.h | |
parent | 24ec594f4ae8189490a0087923fc655e16dde331 (diff) | |
download | FreeBSD-src-071d10f334b2e0094018c4b2027c8e3e73833bc1.zip FreeBSD-src-071d10f334b2e0094018c4b2027c8e3e73833bc1.tar.gz |
This is a bunch of changes from NetBSD. There are a couple of bug-fixes.
But mostly it is changes to use the list-maintenance macros instead of
doing the pointer-gymnastics by hand.
Obtained from: NetBSD
Diffstat (limited to 'sys/nfs/nfs.h')
-rw-r--r-- | sys/nfs/nfs.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h index 844acdc..c79eefb 100644 --- a/sys/nfs/nfs.h +++ b/sys/nfs/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.4 1994/08/21 06:50:08 paul Exp $ + * $Id: nfs.h,v 1.5 1994/10/02 17:26:54 phk Exp $ */ #ifndef _NFS_NFS_H_ @@ -179,8 +179,7 @@ struct nfsstats { * Nfs outstanding request list element */ struct nfsreq { - struct nfsreq *r_next; - struct nfsreq *r_prev; + TAILQ_ENTRY(nfsreq) r_chain; struct mbuf *r_mreq; struct mbuf *r_mrep; struct mbuf *r_md; @@ -197,6 +196,11 @@ struct nfsreq { struct proc *r_procp; /* Proc that did I/O system call */ }; +/* + * Queue head for nfsreq's + */ +TAILQ_HEAD(, nfsreq) nfs_reqq; + /* Flag values for r_flags */ #define R_TIMING 0x01 /* timing request (in mntp) */ #define R_SENT 0x02 /* request has been sent */ @@ -216,7 +220,8 @@ struct nfsstats nfsstats; * and uid hash lists. */ #define NUIDHASHSIZ 32 -#define NUIDHASH(uid) ((uid) & (NUIDHASHSIZ - 1)) +#define NUIDHASH(sock, uid) \ + (&(sock)->ns_uidhashtbl[(uid) & (sock)->ns_uidhash]) /* * Network address hash list element @@ -227,10 +232,8 @@ union nethostaddr { }; struct nfsuid { - struct nfsuid *nu_lrunext; /* MUST be first */ - struct nfsuid *nu_lruprev; - struct nfsuid *nu_hnext; - struct nfsuid *nu_hprev; + TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */ + LIST_ENTRY(nfsuid) nu_hash; /* Hash list */ int nu_flag; /* Flags */ uid_t nu_uid; /* Uid mapped by this entry */ union nethostaddr nu_haddr; /* Host addr. for dgram sockets */ @@ -243,10 +246,11 @@ struct nfsuid { #define NU_INETADDR 0x1 struct nfssvc_sock { - struct nfsuid *ns_lrunext; /* MUST be first */ - struct nfsuid *ns_lruprev; - struct nfssvc_sock *ns_next; - struct nfssvc_sock *ns_prev; + TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */ + TAILQ_HEAD(, nfsuid) ns_uidlruhead; + LIST_HEAD(, nfsuid) *ns_uidhashtbl; + u_long ns_uidhash; + int ns_flag; u_long ns_sref; struct file *ns_fp; @@ -260,7 +264,6 @@ struct nfssvc_sock { struct mbuf *ns_rec; struct mbuf *ns_recend; int ns_numuids; - struct nfsuid *ns_uidh[NUIDHASHSIZ]; }; /* Bits for "ns_flag" */ @@ -269,17 +272,18 @@ struct nfssvc_sock { #define SLP_NEEDQ 0x04 #define SLP_DISCONN 0x08 #define SLP_GETSTREAM 0x10 -#define SLP_INIT 0x20 -#define SLP_WANTINIT 0x40 - #define SLP_ALLFLAGS 0xff +TAILQ_HEAD(, nfssvc_sock) nfssvc_sockhead; +int nfssvc_sockhead_flag; +#define SLP_INIT 0x01 +#define SLP_WANTINIT 0x02 + /* * One of these structures is allocated for each nfsd. */ struct nfsd { - struct nfsd *nd_next; /* Must be first */ - struct nfsd *nd_prev; + TAILQ_ENTRY(nfsd) nd_chain; /* List of all nfsd's */ int nd_flag; /* NFSD_ flags */ struct nfssvc_sock *nd_slp; /* Current socket */ struct mbuf *nd_nam; /* Client addr for datagram req. */ @@ -297,11 +301,15 @@ struct nfsd { struct proc *nd_procp; /* Proc ptr */ }; +/* Bits for "nd_flag" */ #define NFSD_WAITING 0x01 -#define NFSD_CHECKSLP 0x02 -#define NFSD_REQINPROG 0x04 -#define NFSD_NEEDAUTH 0x08 -#define NFSD_AUTHFAIL 0x10 +#define NFSD_REQINPROG 0x02 +#define NFSD_NEEDAUTH 0x04 +#define NFSD_AUTHFAIL 0x08 + +TAILQ_HEAD(, nfsd) nfsd_head; +int nfsd_head_flag; +#define NFSD_CHECKSLP 0x01 int nfs_reply __P((struct nfsreq *)); int nfs_getreq __P((struct nfsd *,int)); @@ -335,7 +343,7 @@ int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); -struct nfsnode ** nfs_hash __P((nfsv2fh_t *)); +struct nfsnodehashhead * nfs_hash __P((nfsv2fh_t *)); int nfssvc_iod __P((struct proc *)); int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); int nfssvc_addsock __P((struct file *,struct mbuf *)); |