summaryrefslogtreecommitdiff
path: root/sys/gnu
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2004-02-04 21:52:57 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2004-02-04 21:52:57 +0000
commit91d5354a2ce810d848eca6ecf9da1027aeb2be6d (patch)
treed9c0a05d62914174d6f00ab22300e935c3e6d983 /sys/gnu
parent890cefab5b3dd6f2a1fbfffae44730a0434b2e84 (diff)
Notes
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c14
-rw-r--r--sys/gnu/fs/ext2fs/ext2_readwrite.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index ba798354f347..c40ae9898581 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -217,15 +217,15 @@ WRITE(ap)
* file servers have no limits, I don't think it matters.
*/
td = uio->uio_td;
- /* For p_rlimit. */
- mtx_assert(&Giant, MA_OWNED);
- if (vp->v_type == VREG && td &&
- uio->uio_offset + uio->uio_resid >
- td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+ if (vp->v_type == VREG && td != NULL) {
PROC_LOCK(td->td_proc);
- psignal(td->td_proc, SIGXFSZ);
+ 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);
- return (EFBIG);
}
resid = uio->uio_resid;
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c
index ba798354f347..c40ae9898581 100644
--- a/sys/gnu/fs/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c
@@ -217,15 +217,15 @@ WRITE(ap)
* file servers have no limits, I don't think it matters.
*/
td = uio->uio_td;
- /* For p_rlimit. */
- mtx_assert(&Giant, MA_OWNED);
- if (vp->v_type == VREG && td &&
- uio->uio_offset + uio->uio_resid >
- td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
+ if (vp->v_type == VREG && td != NULL) {
PROC_LOCK(td->td_proc);
- psignal(td->td_proc, SIGXFSZ);
+ 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);
- return (EFBIG);
}
resid = uio->uio_resid;