summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2010-05-05 16:44:25 +0000
committertrasz <trasz@FreeBSD.org>2010-05-05 16:44:25 +0000
commit402e3baadee30786a2a2fa508b9b7bec572da072 (patch)
treea3e31897fa4432edd5136dad2f999d5ce286bc3c /sys/nfsclient
parenta3da7d7e6937462db7db7ba830332b719a5a46fa (diff)
downloadFreeBSD-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.c15
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;
/*
OpenPOWER on IntegriCloud