Deleted Added
full compact
smbfs_io.c (120770) smbfs_io.c (125454)
1/*
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_io.c 120770 2003-10-04 23:37:38Z alc $
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_io.c 125454 2004-02-04 21:52:57Z jhb $
33 *
34 */
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
38#include <sys/kernel.h>
39#include <sys/proc.h>
40#include <sys/fcntl.h>

--- 231 unchanged lines hidden (view full) ---

272 error = VOP_GETATTR(vp, &vattr, cred, td);
273 if (error) return (error);
274#endif
275 uiop->uio_offset = np->n_size;
276 }
277 }
278 if (uiop->uio_resid == 0)
279 return 0;
33 *
34 */
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
38#include <sys/kernel.h>
39#include <sys/proc.h>
40#include <sys/fcntl.h>

--- 231 unchanged lines hidden (view full) ---

272 error = VOP_GETATTR(vp, &vattr, cred, td);
273 if (error) return (error);
274#endif
275 uiop->uio_offset = np->n_size;
276 }
277 }
278 if (uiop->uio_resid == 0)
279 return 0;
280 if (p && uiop->uio_offset + uiop->uio_resid > p->p_rlimit[RLIMIT_FSIZE].rlim_cur) {
281 PROC_LOCK(td->td_proc);
282 psignal(td->td_proc, SIGXFSZ);
283 PROC_UNLOCK(td->td_proc);
284 return EFBIG;
280 if (p != NULL) {
281 PROC_LOCK(p);
282 if (uiop->uio_offset + uiop->uio_resid >
283 lim_cur(p, RLIMIT_FSIZE)) {
284 psignal(p, SIGXFSZ);
285 PROC_UNLOCK(p);
286 return EFBIG;
287 }
288 PROC_UNLOCK(p);
285 }
286 smb_makescred(&scred, td, cred);
287 error = smb_write(smp->sm_share, np->n_fid, uiop, &scred);
288 SMBVDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid);
289 if (!error) {
290 if (uiop->uio_offset > np->n_size) {
291 np->n_size = uiop->uio_offset;
292 vnode_pager_setsize(vp, np->n_size);

--- 425 unchanged lines hidden ---
289 }
290 smb_makescred(&scred, td, cred);
291 error = smb_write(smp->sm_share, np->n_fid, uiop, &scred);
292 SMBVDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid);
293 if (!error) {
294 if (uiop->uio_offset > np->n_size) {
295 np->n_size = uiop->uio_offset;
296 vnode_pager_setsize(vp, np->n_size);

--- 425 unchanged lines hidden ---