Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfs/nfsport.h
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* These types must be defined before the nfs includes. | * These types must be defined before the nfs includes. | ||||
*/ | */ | ||||
#define NFSSOCKADDR_T struct sockaddr * | #define NFSSOCKADDR_T struct sockaddr * | ||||
#define NFSPROC_T struct thread | #define NFSPROC_T struct thread | ||||
#define NFSDEV_T dev_t | #define NFSDEV_T dev_t | ||||
#define NFSSVCARGS nfssvc_args | #define NFSSVCARGS nfssvc_args | ||||
#define NFSACL_T struct acl | #define NFSACL_T struct acl | ||||
typedef enum { NOTRUN, RUNJAIL, RUNNOJAIL } nfsd_run; | |||||
/* | /* | ||||
* These should be defined as the types used for the corresponding VOP's | * These should be defined as the types used for the corresponding VOP's | ||||
* argument type. | * argument type. | ||||
*/ | */ | ||||
#define NFS_ACCESS_ARGS struct vop_access_args | #define NFS_ACCESS_ARGS struct vop_access_args | ||||
#define NFS_OPEN_ARGS struct vop_open_args | #define NFS_OPEN_ARGS struct vop_open_args | ||||
#define NFS_GETATTR_ARGS struct vop_getattr_args | #define NFS_GETATTR_ARGS struct vop_getattr_args | ||||
Show All 38 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 VNET_NFSD. */ | |||||
#ifdef VNET_NFSD | |||||
#if !defined(VIMAGE) || !defined(NFSD) | |||||
rmacklem: This CTASSERT is bogus and should be deleted.
| |||||
options VNET_NFSD also requires options NFSD and VIMAGE | |||||
#endif | |||||
#define NFSDSTATS(s) 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; \ | |||||
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 /* !VNET_NFSD */ | |||||
#define NFSDSTATS(s) s | |||||
#define NFSDSTATSDECLARE(s) extern struct s s | |||||
#define NFSDSTATSDEFINE(s) | |||||
#define nfsd_copy_vnetstats() | |||||
#define nfsd_zero_vnetstats() | |||||
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… | |||||
#endif /* VNET_NFSD */ | |||||
#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 296 Lines • ▼ Show 20 Lines | struct nfsstatsv1 { | ||||
uint64_t clopens; | uint64_t clopens; | ||||
uint64_t cllockowners; | uint64_t cllockowners; | ||||
uint64_t cllocks; | uint64_t cllocks; | ||||
uint64_t cldelegates; | uint64_t cldelegates; | ||||
uint64_t cllocalopenowners; | uint64_t cllocalopenowners; | ||||
uint64_t cllocalopens; | uint64_t cllocalopens; | ||||
uint64_t cllocallockowners; | uint64_t cllocallockowners; | ||||
uint64_t cllocallocks; | uint64_t cllocallocks; | ||||
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; | |||||
}; | |||||
/* | |||||
* Subset of above structure that needs to be vnet'd for the case | |||||
* of VNET_NFSD. | |||||
*/ | |||||
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 srvstartcnt; | ||||
uint64_t srvdonecnt; | uint64_t srvdonecnt; | ||||
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; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 714 Lines • Show Last 20 Lines |
This CTASSERT is bogus and should be deleted.