Changeset View
Standalone View
fs/nfs/nfsrvstate.h
Context not available. | |||||
TAILQ_HEAD(nfsuserlruhead, nfsusrgrp); | TAILQ_HEAD(nfsuserlruhead, nfsusrgrp); | ||||
#define NFSCLIENTHASH(id) \ | #define NFSCLIENTHASH(id) \ | ||||
(&nfsclienthash[(id).lval[1] % NFSCLIENTHASHSIZE]) | (&nfsclienthash[(id).lval[1] % nfsrv_clienthashsize]) | ||||
#define NFSSTATEHASH(clp, id) \ | #define NFSSTATEHASH(clp, id) \ | ||||
(&((clp)->lc_stateid[(id).other[2] % NFSSTATEHASHSIZE])) | (&((clp)->lc_stateid[(id).other[2] % nfsrv_statehashsize])) | ||||
#define NFSUSERHASH(id) \ | #define NFSUSERHASH(id) \ | ||||
(&nfsuserhash[(id) % NFSUSERHASHSIZE]) | (&nfsuserhash[(id) % NFSUSERHASHSIZE]) | ||||
#define NFSUSERNAMEHASH(p, l) \ | #define NFSUSERNAMEHASH(p, l) \ | ||||
Context not available. | |||||
struct nfssessionhashhead list; | struct nfssessionhashhead list; | ||||
}; | }; | ||||
#define NFSSESSIONHASH(f) \ | #define NFSSESSIONHASH(f) \ | ||||
(&nfssessionhash[nfsrv_hashsessionid(f) % NFSSESSIONHASHSIZE]) | (&nfssessionhash[nfsrv_hashsessionid(f) % nfsrv_sessionhashsize]) | ||||
/* | /* | ||||
* Client server structure for V4. It is doubly linked into two lists. | * Client server structure for V4. It is doubly linked into two lists. | ||||
Context not available. | |||||
*/ | */ | ||||
struct nfsclient { | struct nfsclient { | ||||
LIST_ENTRY(nfsclient) lc_hash; /* Clientid hash list */ | LIST_ENTRY(nfsclient) lc_hash; /* Clientid hash list */ | ||||
struct nfsstatehead lc_stateid[NFSSTATEHASHSIZE]; /* stateid hash */ | |||||
struct nfsstatehead lc_open; /* Open owner list */ | struct nfsstatehead lc_open; /* Open owner list */ | ||||
struct nfsstatehead lc_deleg; /* Delegations */ | struct nfsstatehead lc_deleg; /* Delegations */ | ||||
struct nfsstatehead lc_olddeleg; /* and old delegations */ | struct nfsstatehead lc_olddeleg; /* and old delegations */ | ||||
Context not available. | |||||
u_int32_t lc_cbref; /* Cnt of callbacks */ | u_int32_t lc_cbref; /* Cnt of callbacks */ | ||||
uid_t lc_uid; /* User credential */ | uid_t lc_uid; /* User credential */ | ||||
gid_t lc_gid; | gid_t lc_gid; | ||||
u_int16_t lc_namelen; | u_int16_t lc_idlen; /* Client ID and len */ | ||||
u_int16_t lc_namelen; /* plus GSS principal and len */ | |||||
u_char *lc_id; | |||||
u_char *lc_name; | u_char *lc_name; | ||||
struct nfssockreq lc_req; /* Callback info */ | struct nfssockreq lc_req; /* Callback info */ | ||||
u_short lc_idlen; /* Length of id string */ | |||||
u_int32_t lc_flags; /* LCL_ flag bits */ | u_int32_t lc_flags; /* LCL_ flag bits */ | ||||
u_char lc_verf[NFSX_VERF]; /* client verifier */ | u_char lc_verf[NFSX_VERF]; /* client verifier */ | ||||
u_char lc_id[1]; /* Malloc'd correct size */ | struct nfsstatehead lc_stateid[0]; /* stateid hash, malloc'd to size */ | ||||
kib: Wouldn't it be cleaner to declare lc_id as u_char *lc_id ? Also, why the type is u_char ? | |||||
Not Done Inline ActionsWell, the structure is allocated large enough to If you think lc_id[0] is clearer, that's easy to change. All that is needed is a "+ 1" on the size This is normally small, so I don't think a 3rd As for u_char, it's just 8bit arbitrary bytes, so rmacklem: Well, the structure is allocated large enough to
store the actual "id", which is an 8bit byte… | |||||
}; | }; | ||||
#define CLOPS_CONFIRM 0x0001 | #define CLOPS_CONFIRM 0x0001 | ||||
Context not available. |
Wouldn't it be cleaner to declare lc_id as u_char *lc_id ? Also, why the type is u_char ?