summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/smbfs')
-rw-r--r--sys/fs/smbfs/smbfs_io.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index 6537ed4..7e021c1 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -28,9 +28,7 @@
*/
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
#include <sys/kernel.h>
-#include <sys/proc.h>
#include <sys/fcntl.h>
#include <sys/bio.h>
#include <sys/buf.h>
@@ -235,7 +233,6 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop,
struct smbmount *smp = VTOSMBFS(vp);
struct smbnode *np = VTOSMB(vp);
struct smb_cred scred;
- struct proc *p;
struct thread *td;
int error = 0;
@@ -249,7 +246,6 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop,
/* if (uiop->uio_offset + uiop->uio_resid > smp->nm_maxfilesize)
return (EFBIG);*/
td = uiop->uio_td;
- p = td->td_proc;
if (ioflag & (IO_APPEND | IO_SYNC)) {
if (np->n_flag & NMODIFIED) {
smbfs_attr_cacheremove(vp);
@@ -271,16 +267,10 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop,
}
if (uiop->uio_resid == 0)
return 0;
- if (p != NULL) {
- PROC_LOCK(p);
- if (uiop->uio_offset + uiop->uio_resid >
- lim_cur(p, RLIMIT_FSIZE)) {
- psignal(p, SIGXFSZ);
- PROC_UNLOCK(p);
- return EFBIG;
- }
- PROC_UNLOCK(p);
- }
+
+ if (vn_rlimit_fsize(vp, uiop, td))
+ return (EFBIG);
+
smb_makescred(&scred, td, cred);
error = smb_write(smp->sm_share, np->n_fid, uiop, &scred);
SMBVDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid);
OpenPOWER on IntegriCloud