diff options
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 3 | ||||
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 3 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 6 | ||||
-rw-r--r-- | sys/sys/vnode.h | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index f38c72b..7a19412 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -652,7 +652,6 @@ msdosfs_write(ap) struct buf *bp; int ioflag = ap->a_ioflag; struct uio *uio = ap->a_uio; - struct thread *td = uio->uio_td; struct vnode *vp = ap->a_vp; struct vnode *thisvp; struct denode *dep = VTODE(vp); @@ -696,7 +695,7 @@ msdosfs_write(ap) /* * If they've exceeded their filesize limit, tell them about it. */ - if (vn_rlimit_fsize(vp, uio, td)) + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) return (EFBIG); /* diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 3ffef6b..330eea5 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -717,7 +717,6 @@ tmpfs_write(struct vop_write_args *v) struct vnode *vp = v->a_vp; struct uio *uio = v->a_uio; int ioflag = v->a_ioflag; - struct thread *td = uio->uio_td; boolean_t extended; int error = 0; @@ -747,7 +746,7 @@ tmpfs_write(struct vop_write_args *v) VFS_TO_TMPFS(vp->v_mount)->tm_maxfilesize) return (EFBIG); - if (vn_rlimit_fsize(vp, uio, td)) + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) return (EFBIG); extended = uio->uio_offset + uio->uio_resid > node->tn_size; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index edc7ea8..28a6e21 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1341,11 +1341,12 @@ vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp) } int -vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, const struct thread *td) +vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, + const struct thread *td) { + if (vp->v_type != VREG || td == NULL) return (0); - PROC_LOCK(td->td_proc); if (uio->uio_offset + uio->uio_resid > lim_cur(td->td_proc, RLIMIT_FSIZE)) { @@ -1354,6 +1355,5 @@ vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, const struct thre return (EFBIG); } PROC_UNLOCK(td->td_proc); - return (0); } diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 7c4ae32..64b3ce4 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -655,6 +655,8 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, size_t *aresid, struct thread *td); +int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio, + const struct thread *td); int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred, struct ucred *file_cred, struct thread *td); int vn_start_write(struct vnode *vp, struct mount **mpp, int flags); @@ -670,6 +672,7 @@ int vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace, int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp); + int vfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp); @@ -780,7 +783,6 @@ struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_unixify_accmode(accmode_t *accmode); -int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio, const struct thread *td); #endif /* _KERNEL */ |