Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_io.c
Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | fuse_io_strategy(struct vnode *vp, struct buf *bp) | ||||
if (bp->b_iocmd == BIO_READ) { | if (bp->b_iocmd == BIO_READ) { | ||||
io.iov_len = uiop->uio_resid = bp->b_bcount; | io.iov_len = uiop->uio_resid = bp->b_bcount; | ||||
io.iov_base = bp->b_data; | io.iov_base = bp->b_data; | ||||
uiop->uio_rw = UIO_READ; | uiop->uio_rw = UIO_READ; | ||||
uiop->uio_offset = ((off_t)bp->b_blkno) * biosize; | uiop->uio_offset = ((off_t)bp->b_blkno) * biosize; | ||||
error = fuse_read_directbackend(vp, uiop, cred, fufh); | error = fuse_read_directbackend(vp, uiop, cred, fufh); | ||||
/* XXXCEM: Potentially invalid access to cached_attrs here */ | |||||
if ((!error && uiop->uio_resid) || | if ((!error && uiop->uio_resid) || | ||||
(fsess_opt_brokenio(vnode_mount(vp)) && error == EIO && | (fsess_opt_brokenio(vnode_mount(vp)) && error == EIO && | ||||
uiop->uio_offset < fvdat->filesize && fvdat->filesize > 0 && | uiop->uio_offset < fvdat->filesize && fvdat->filesize > 0 && | ||||
uiop->uio_offset >= fvdat->cached_attrs.va_size)) { | uiop->uio_offset >= fvdat->cached_attrs.va_size)) { | ||||
/* | /* | ||||
* If we had a short read with no error, we must have | * If we had a short read with no error, we must have | ||||
* hit a file hole. We should zero-fill the remainder. | * hit a file hole. We should zero-fill the remainder. | ||||
* This can also occur if the server hits the file EOF. | * This can also occur if the server hits the file EOF. | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |