Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/devfs/devfs_vnops.c
Show First 20 Lines • Show All 1,299 Lines • ▼ Show 20 Lines | devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, | ||||
foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); | foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); | ||||
error = dsw->d_read(dev, uio, ioflag); | error = dsw->d_read(dev, uio, ioflag); | ||||
if (uio->uio_resid != resid || (error == 0 && resid != 0)) | if (uio->uio_resid != resid || (error == 0 && resid != 0)) | ||||
devfs_timestamp(&dev->si_atime); | devfs_timestamp(&dev->si_atime); | ||||
td->td_fpop = fpop; | td->td_fpop = fpop; | ||||
dev_relthread(dev, ref); | dev_relthread(dev, ref); | ||||
foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); | foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF_R); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
devfs_readdir(struct vop_readdir_args *ap) | devfs_readdir(struct vop_readdir_args *ap) | ||||
{ | { | ||||
int error; | int error; | ||||
struct uio *uio; | struct uio *uio; | ||||
▲ Show 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, | ||||
error = dsw->d_write(dev, uio, ioflag); | error = dsw->d_write(dev, uio, ioflag); | ||||
if (uio->uio_resid != resid || (error == 0 && resid != 0)) { | if (uio->uio_resid != resid || (error == 0 && resid != 0)) { | ||||
devfs_timestamp(&dev->si_ctime); | devfs_timestamp(&dev->si_ctime); | ||||
dev->si_mtime = dev->si_ctime; | dev->si_mtime = dev->si_ctime; | ||||
} | } | ||||
td->td_fpop = fpop; | td->td_fpop = fpop; | ||||
dev_relthread(dev, ref); | dev_relthread(dev, ref); | ||||
foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); | foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF_W); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
devfs_mmap_f(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, | devfs_mmap_f(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, | ||||
vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, | vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, | ||||
struct thread *td) | struct thread *td) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |