Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsserver/nfs_nfsdport.c
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
extern struct nfsrv_stablefirst nfsrv_stablefirst; | extern struct nfsrv_stablefirst nfsrv_stablefirst; | ||||
extern void (*nfsd_call_servertimer)(void); | extern void (*nfsd_call_servertimer)(void); | ||||
extern SVCPOOL *nfsrvd_pool; | extern SVCPOOL *nfsrvd_pool; | ||||
extern struct nfsv4lock nfsd_suspend_lock; | extern struct nfsv4lock nfsd_suspend_lock; | ||||
extern struct nfsclienthashhead *nfsclienthash; | extern struct nfsclienthashhead *nfsclienthash; | ||||
extern struct nfslockhashhead *nfslockhash; | extern struct nfslockhashhead *nfslockhash; | ||||
extern struct nfssessionhash *nfssessionhash; | extern struct nfssessionhash *nfssessionhash; | ||||
extern int nfsrv_sessionhashsize; | extern int nfsrv_sessionhashsize; | ||||
extern struct nfsstatsv1 nfsstatsv1; | |||||
struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; | struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; | ||||
NFSDLOCKMUTEX; | NFSDLOCKMUTEX; | ||||
struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; | struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; | ||||
struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; | struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; | ||||
struct mtx nfsrc_udpmtx; | struct mtx nfsrc_udpmtx; | ||||
struct mtx nfs_v4root_mutex; | struct mtx nfs_v4root_mutex; | ||||
struct nfsrvfh nfs_rootfh, nfs_pubfh; | struct nfsrvfh nfs_rootfh, nfs_pubfh; | ||||
int nfs_pubfhset = 0, nfs_rootfhset = 0; | int nfs_pubfhset = 0, nfs_rootfhset = 0; | ||||
▲ Show 20 Lines • Show All 608 Lines • ▼ Show 20 Lines | nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred, | ||||
uiop->uio_iovcnt = i; | uiop->uio_iovcnt = i; | ||||
uiop->uio_offset = off; | uiop->uio_offset = off; | ||||
uiop->uio_resid = len; | uiop->uio_resid = len; | ||||
uiop->uio_rw = UIO_READ; | uiop->uio_rw = UIO_READ; | ||||
uiop->uio_segflg = UIO_SYSSPACE; | uiop->uio_segflg = UIO_SYSSPACE; | ||||
uiop->uio_td = NULL; | uiop->uio_td = NULL; | ||||
nh = nfsrv_sequential_heuristic(uiop, vp); | nh = nfsrv_sequential_heuristic(uiop, vp); | ||||
ioflag |= nh->nh_seqcount << IO_SEQSHIFT; | ioflag |= nh->nh_seqcount << IO_SEQSHIFT; | ||||
/* XXX KDM make this more systematic? */ | |||||
nfsstatsv1.srvbytes[NFSV4OP_READ] += uiop->uio_resid; | |||||
error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); | error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); | ||||
FREE((caddr_t)iv2, M_TEMP); | FREE((caddr_t)iv2, M_TEMP); | ||||
if (error) { | if (error) { | ||||
m_freem(m3); | m_freem(m3); | ||||
*mpp = NULL; | *mpp = NULL; | ||||
goto out; | goto out; | ||||
} | } | ||||
nh->nh_nextoff = uiop->uio_offset; | nh->nh_nextoff = uiop->uio_offset; | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | else | ||||
ioflags = (IO_SYNC | IO_NODELOCKED); | ioflags = (IO_SYNC | IO_NODELOCKED); | ||||
uiop->uio_resid = retlen; | uiop->uio_resid = retlen; | ||||
uiop->uio_rw = UIO_WRITE; | uiop->uio_rw = UIO_WRITE; | ||||
uiop->uio_segflg = UIO_SYSSPACE; | uiop->uio_segflg = UIO_SYSSPACE; | ||||
NFSUIOPROC(uiop, p); | NFSUIOPROC(uiop, p); | ||||
uiop->uio_offset = off; | uiop->uio_offset = off; | ||||
nh = nfsrv_sequential_heuristic(uiop, vp); | nh = nfsrv_sequential_heuristic(uiop, vp); | ||||
ioflags |= nh->nh_seqcount << IO_SEQSHIFT; | ioflags |= nh->nh_seqcount << IO_SEQSHIFT; | ||||
/* XXX KDM make this more systematic? */ | |||||
nfsstatsv1.srvbytes[NFSV4OP_WRITE] += uiop->uio_resid; | |||||
error = VOP_WRITE(vp, uiop, ioflags, cred); | error = VOP_WRITE(vp, uiop, ioflags, cred); | ||||
if (error == 0) | if (error == 0) | ||||
nh->nh_nextoff = uiop->uio_offset; | nh->nh_nextoff = uiop->uio_offset; | ||||
FREE((caddr_t)iv, M_TEMP); | FREE((caddr_t)iv, M_TEMP); | ||||
NFSEXITCODE(error); | NFSEXITCODE(error); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,666 Lines • Show Last 20 Lines |