Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsclient/nfs_clbio.c
Context not available. | |||||
#include <fs/nfsclient/nfs_kdtrace.h> | #include <fs/nfsclient/nfs_kdtrace.h> | ||||
extern int newnfs_directio_allow_mmap; | extern int newnfs_directio_allow_mmap; | ||||
extern struct nfsstats newnfsstats; | extern struct nfsstatsv1 nfsstatsv1; | ||||
extern struct mtx ncl_iod_mutex; | extern struct mtx ncl_iod_mutex; | ||||
extern int ncl_numasync; | extern int ncl_numasync; | ||||
extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; | extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; | ||||
Context not available. | |||||
switch (vp->v_type) { | switch (vp->v_type) { | ||||
case VREG: | case VREG: | ||||
NFSINCRGLOBAL(newnfsstats.biocache_reads); | NFSINCRGLOBAL(nfsstatsv1.biocache_reads); | ||||
lbn = uio->uio_offset / biosize; | lbn = uio->uio_offset / biosize; | ||||
on = uio->uio_offset - (lbn * biosize); | on = uio->uio_offset - (lbn * biosize); | ||||
Context not available. | |||||
n = MIN((unsigned)(bcount - on), uio->uio_resid); | n = MIN((unsigned)(bcount - on), uio->uio_resid); | ||||
break; | break; | ||||
case VLNK: | case VLNK: | ||||
NFSINCRGLOBAL(newnfsstats.biocache_readlinks); | NFSINCRGLOBAL(nfsstatsv1.biocache_readlinks); | ||||
bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td); | bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td); | ||||
if (!bp) { | if (!bp) { | ||||
error = newnfs_sigintr(nmp, td); | error = newnfs_sigintr(nmp, td); | ||||
Context not available. | |||||
on = 0; | on = 0; | ||||
break; | break; | ||||
case VDIR: | case VDIR: | ||||
NFSINCRGLOBAL(newnfsstats.biocache_readdirs); | NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs); | ||||
if (np->n_direofoffset | if (np->n_direofoffset | ||||
&& uio->uio_offset >= np->n_direofoffset) { | && uio->uio_offset >= np->n_direofoffset) { | ||||
return (0); | return (0); | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
NFSINCRGLOBAL(newnfsstats.biocache_writes); | NFSINCRGLOBAL(nfsstatsv1.biocache_writes); | ||||
lbn = uio->uio_offset / biosize; | lbn = uio->uio_offset / biosize; | ||||
on = uio->uio_offset - (lbn * biosize); | on = uio->uio_offset - (lbn * biosize); | ||||
n = MIN((unsigned)(biosize - on), uio->uio_resid); | n = MIN((unsigned)(biosize - on), uio->uio_resid); | ||||
Context not available. | |||||
switch (vp->v_type) { | switch (vp->v_type) { | ||||
case VREG: | case VREG: | ||||
uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE; | uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE; | ||||
NFSINCRGLOBAL(newnfsstats.read_bios); | NFSINCRGLOBAL(nfsstatsv1.read_bios); | ||||
error = ncl_readrpc(vp, uiop, cr); | error = ncl_readrpc(vp, uiop, cr); | ||||
if (!error) { | if (!error) { | ||||
Context not available. | |||||
break; | break; | ||||
case VLNK: | case VLNK: | ||||
uiop->uio_offset = (off_t)0; | uiop->uio_offset = (off_t)0; | ||||
NFSINCRGLOBAL(newnfsstats.readlink_bios); | NFSINCRGLOBAL(nfsstatsv1.readlink_bios); | ||||
error = ncl_readlinkrpc(vp, uiop, cr); | error = ncl_readlinkrpc(vp, uiop, cr); | ||||
break; | break; | ||||
case VDIR: | case VDIR: | ||||
NFSINCRGLOBAL(newnfsstats.readdir_bios); | NFSINCRGLOBAL(nfsstatsv1.readdir_bios); | ||||
uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ; | uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ; | ||||
if ((nmp->nm_flag & NFSMNT_RDIRPLUS) != 0) { | if ((nmp->nm_flag & NFSMNT_RDIRPLUS) != 0) { | ||||
error = ncl_readdirplusrpc(vp, uiop, cr, td); | error = ncl_readdirplusrpc(vp, uiop, cr, td); | ||||
Context not available. | |||||
+ bp->b_dirtyoff; | + bp->b_dirtyoff; | ||||
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff; | io.iov_base = (char *)bp->b_data + bp->b_dirtyoff; | ||||
uiop->uio_rw = UIO_WRITE; | uiop->uio_rw = UIO_WRITE; | ||||
NFSINCRGLOBAL(newnfsstats.write_bios); | NFSINCRGLOBAL(nfsstatsv1.write_bios); | ||||
if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | B_CLUSTER)) == B_ASYNC) | if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | B_CLUSTER)) == B_ASYNC) | ||||
iomode = NFSWRITE_UNSTABLE; | iomode = NFSWRITE_UNSTABLE; | ||||
Context not available. |