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/nfsclient | |
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/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index 3a0705e..13effd0 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include <sys/mbuf.h> #include <sys/mount.h> #include <sys/proc.h> -#include <sys/resourcevar.h> -#include <sys/signalvar.h> #include <sys/vmmeter.h> #include <sys/vnode.h> @@ -873,7 +871,6 @@ nfs_write(struct vop_write_args *ap) daddr_t lbn; int bcount; int n, on, error = 0; - struct proc *p = td?td->td_proc:NULL; #ifdef DIAGNOSTIC if (uio->uio_rw != UIO_WRITE) @@ -954,16 +951,8 @@ flush_and_restart: * Maybe this should be above the vnode op call, but so long as * file servers have no limits, i don't think it matters */ - if (p != NULL) { - PROC_LOCK(p); - if (uio->uio_offset + uio->uio_resid > - lim_cur(p, RLIMIT_FSIZE)) { - psignal(p, SIGXFSZ); - PROC_UNLOCK(p); - return (EFBIG); - } - PROC_UNLOCK(p); - } + if (vn_rlimit_fsize(vp, uio, td)) + return (EFBIG); biosize = vp->v_mount->mnt_stat.f_iosize; /* |