Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfs/nfsport.h
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#define NFSV4CL_LOCKNAMELEN 12 | #define NFSV4CL_LOCKNAMELEN 12 | ||||
/* | /* | ||||
* Type for a mutex lock. | * Type for a mutex lock. | ||||
*/ | */ | ||||
#define NFSMUTEX_T struct mtx | #define NFSMUTEX_T struct mtx | ||||
/* Macros for VIMAGE. */ | |||||
/* Just define the NFSD_VNETxxx() macros as VNETxxx() macros. */ | |||||
#define NFSD_VNET_NAME(n) VNET_NAME(n) | |||||
rmacklem: This CTASSERT is bogus and should be deleted.
| |||||
#define NFSD_VNET_DECLARE(t, n) VNET_DECLARE(t, n) | |||||
#define NFSD_VNET_DEFINE(t, n) VNET_DEFINE(t, n) | |||||
#define NFSD_VNET_DEFINE_STATIC(t, n) VNET_DEFINE_STATIC(t, n) | |||||
#define NFSD_VNET(n) VNET(n) | |||||
#define CTLFLAG_NFSD_VNET CTLFLAG_VNET | |||||
#define NFSD_CURVNET_SET(n) CURVNET_SET(n) | |||||
#define NFSD_CURVNET_SET_QUIET(n) CURVNET_SET_QUIET(n) | |||||
#define NFSD_CURVNET_RESTORE() CURVNET_RESTORE() | |||||
#define NFSD_TD_TO_VNET(n) TD_TO_VNET(n) | |||||
#ifdef VIMAGE | |||||
#define NFSDSTATS() VNET(nfsstatsv1_vnet) | |||||
#define NFSDSTATSDECLARE(s) \ | |||||
VNET_DECLARE(struct nfsstatsv1_vnet *, nfsstatsv1_vnet) | |||||
#define NFSDSTATSDEFINE(s) \ | |||||
VNET_DEFINE(struct nfsstatsv1_vnet *, nfsstatsv1_vnet) | |||||
#define nfsd_copy_vnetstats() do { \ | |||||
int iii; \ | |||||
NFSBCOPY(&nfsstatsv1, outstats, sizeof(nfsstatsv1)); \ | |||||
for (iii = 0; iii < NFSV42_NOPS + NFSV4OP_FAKENOPS; iii++) { \ | |||||
outstats->srvrpccnt[iii] = \ | |||||
VNET(nfsstatsv1_vnet)->srvrpccnt[iii]; \ | |||||
outstats->srvbytes[iii] = \ | |||||
VNET(nfsstatsv1_vnet)->srvbytes[iii]; \ | |||||
outstats->srvops[iii] = \ | |||||
VNET(nfsstatsv1_vnet)->srvops[iii]; \ | |||||
outstats->srvduration[iii] = \ | |||||
VNET(nfsstatsv1_vnet)->srvduration[iii]; \ | |||||
} \ | |||||
outstats->srvlayouts = VNET(nfsstatsv1_vnet)->srvlayouts; \ | |||||
outstats->srvcache_inproghits = \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_inproghits; \ | |||||
outstats->srvcache_nonidemdonehits = \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_nonidemdonehits; \ | |||||
outstats->srvcache_misses = \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_misses; \ | |||||
outstats->srvcache_tcppeak = \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_tcppeak; \ | |||||
outstats->srvcache_size = VNET(nfsstatsv1_vnet)->srvcache_size; \ | |||||
outstats->srvclients = VNET(nfsstatsv1_vnet)->srvclients; \ | |||||
outstats->srvopenowners = VNET(nfsstatsv1_vnet)->srvopenowners; \ | |||||
outstats->srvopens = VNET(nfsstatsv1_vnet)->srvopens; \ | |||||
outstats->srvlockowners = VNET(nfsstatsv1_vnet)->srvlockowners; \ | |||||
Not Done Inline ActionsIs is the below all duplicated here? bz: Is is the below all duplicated here? | |||||
Done Inline ActionsNot sure what you are referring to w.r.t. duplicated. There are macros for the VNET_NFSD case and macros For the non-VNET_NFSD case, the macros basically just do rmacklem: Not sure what you are referring to w.r.t. duplicated.
There are macros for the VNET_NFSD case… | |||||
outstats->srvlocks = VNET(nfsstatsv1_vnet)->srvlocks; \ | |||||
outstats->srvdelegates = VNET(nfsstatsv1_vnet)->srvdelegates; \ | |||||
outstats->srvstartcnt = VNET(nfsstatsv1_vnet)->srvstartcnt; \ | |||||
outstats->srvdonecnt = VNET(nfsstatsv1_vnet)->srvdonecnt; \ | |||||
outstats->busyfrom = VNET(nfsstatsv1_vnet)->busyfrom; \ | |||||
outstats->busytime = VNET(nfsstatsv1_vnet)->busytime; \ | |||||
} while (0) | |||||
#define nfsd_zero_vnetstats() do { \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_inproghits = 0; \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_nonidemdonehits = 0; \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_misses = 0; \ | |||||
VNET(nfsstatsv1_vnet)->srvcache_tcppeak = 0; \ | |||||
bzero(VNET(nfsstatsv1_vnet)->srvrpccnt, \ | |||||
sizeof(nfsstatsv1.srvrpccnt)); \ | |||||
} while (0) | |||||
#else /* !VIMAGE */ | |||||
#define NFSDSTATS() (&nfsstatsv1) | |||||
#define NFSDSTATSDECLARE(s) extern struct s s | |||||
#define NFSDSTATSDEFINE(s) | |||||
#define nfsd_copy_vnetstats() | |||||
#define nfsd_zero_vnetstats() | |||||
#endif /* VIMAGE */ | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
/* | /* | ||||
* NFSv4 Operation numbers. | * NFSv4 Operation numbers. | ||||
*/ | */ | ||||
#define NFSV4OP_ACCESS 3 | #define NFSV4OP_ACCESS 3 | ||||
#define NFSV4OP_CLOSE 4 | #define NFSV4OP_CLOSE 4 | ||||
#define NFSV4OP_COMMIT 5 | #define NFSV4OP_COMMIT 5 | ||||
▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | struct nfsstatsv1 { | ||||
uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | ||||
uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | ||||
struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | ||||
struct bintime busyfrom; | struct bintime busyfrom; | ||||
struct bintime busytime; | struct bintime busytime; | ||||
}; | }; | ||||
/* | /* | ||||
* Subset of above structure that needs to be vnet'd for the case | |||||
* of VIMAGE. | |||||
*/ | |||||
struct nfsstatsv1_vnet { | |||||
uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | |||||
uint64_t srvlayouts; | |||||
uint64_t srvcache_inproghits; | |||||
uint64_t srvcache_nonidemdonehits; | |||||
uint64_t srvcache_misses; | |||||
uint64_t srvcache_tcppeak; | |||||
int srvcache_size; /* Updated by atomic_xx_int(). */ | |||||
uint64_t srvclients; | |||||
uint64_t srvopenowners; | |||||
uint64_t srvopens; | |||||
uint64_t srvlockowners; | |||||
uint64_t srvlocks; | |||||
uint64_t srvdelegates; | |||||
uint64_t srvstartcnt; | |||||
uint64_t srvdonecnt; | |||||
uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | |||||
uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | |||||
struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; | |||||
struct bintime busyfrom; | |||||
struct bintime busytime; | |||||
}; | |||||
/* | |||||
* Newer stats structure. | * Newer stats structure. | ||||
* The vers field will be set to NFSSTATS_OV1 by the caller. | * The vers field will be set to NFSSTATS_OV1 by the caller. | ||||
*/ | */ | ||||
#define NFSSTATS_OV1 1 | #define NFSSTATS_OV1 1 | ||||
struct nfsstatsov1 { | struct nfsstatsov1 { | ||||
int vers; /* Set to version requested by caller. */ | int vers; /* Set to version requested by caller. */ | ||||
uint64_t attrcache_hits; | uint64_t attrcache_hits; | ||||
uint64_t attrcache_misses; | uint64_t attrcache_misses; | ||||
▲ Show 20 Lines • Show All 643 Lines • ▼ Show 20 Lines | struct nfsreq { | ||||
u_int32_t r_flags; /* flags on request, see below */ | u_int32_t r_flags; /* flags on request, see below */ | ||||
struct nfsmount *r_nmp; /* Client mnt ptr */ | struct nfsmount *r_nmp; /* Client mnt ptr */ | ||||
struct mtx r_mtx; /* Mutex lock for this structure */ | struct mtx r_mtx; /* Mutex lock for this structure */ | ||||
}; | }; | ||||
#ifndef NFS_MAXBSIZE | #ifndef NFS_MAXBSIZE | ||||
#define NFS_MAXBSIZE (maxbcachebuf) | #define NFS_MAXBSIZE (maxbcachebuf) | ||||
#endif | #endif | ||||
/* User/group hash structure for nfsuserhash and friends. */ | |||||
struct nfsrv_lughash { | |||||
struct mtx mtx; | |||||
struct nfsuserhashhead lughead; | |||||
}; | |||||
/* | /* | ||||
* This macro checks to see if issuing of delegations is allowed for this | * This macro checks to see if issuing of delegations is allowed for this | ||||
* vnode. | * vnode. | ||||
*/ | */ | ||||
#ifdef VV_DISABLEDELEG | #ifdef VV_DISABLEDELEG | ||||
#define NFSVNO_DELEGOK(v) \ | #define NFSVNO_DELEGOK(v) \ | ||||
((v) == NULL || ((v)->v_vflag & VV_DISABLEDELEG) == 0) | ((v) == NULL || ((v)->v_vflag & VV_DISABLEDELEG) == 0) | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
This CTASSERT is bogus and should be deleted.