diff options
author | trasz <trasz@FreeBSD.org> | 2010-05-05 16:44:25 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2010-05-05 16:44:25 +0000 |
commit | 402e3baadee30786a2a2fa508b9b7bec572da072 (patch) | |
tree | a3e31897fa4432edd5136dad2f999d5ce286bc3c /sys/ufs | |
parent | a3da7d7e6937462db7db7ba830332b719a5a46fa (diff) | |
download | FreeBSD-src-402e3baadee30786a2a2fa508b9b7bec572da072.zip FreeBSD-src-402e3baadee30786a2a2fa508b9b7bec572da072.tar.gz |
Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().
Reviewed by: kib
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index e6617cb..85f8ffd 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -75,9 +75,6 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/mount.h> #include <sys/priv.h> -#include <sys/proc.h> -#include <sys/resourcevar.h> -#include <sys/signalvar.h> #include <sys/stat.h> #include <sys/vmmeter.h> #include <sys/vnode.h> @@ -652,7 +649,6 @@ ffs_write(ap) struct inode *ip; struct fs *fs; struct buf *bp; - struct thread *td; ufs_lbn_t lbn; off_t osize; int seqcount; @@ -704,17 +700,8 @@ ffs_write(ap) * Maybe this should be above the vnode op call, but so long as * file servers have no limits, I don't think it matters. */ - td = uio->uio_td; - if (vp->v_type == VREG && td != NULL) { - PROC_LOCK(td->td_proc); - if (uio->uio_offset + uio->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) + return (EFBIG); resid = uio->uio_resid; osize = ip->i_size; |