Deleted Added
full compact
smbfs_io.c (176559) smbfs_io.c (182371)
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 176559 2008-02-25 18:45:57Z attilio $
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_io.c 182371 2008-08-28 15:23:18Z attilio $
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>

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

210 if (lks == LK_SHARED)
211 vn_lock(vp, LK_DOWNGRADE | LK_RETRY);
212 return error;
213 }
214
215/* biosize = SSTOCN(smp->sm_share)->sc_txmax;*/
216 if (np->n_flag & NMODIFIED) {
217 smbfs_attr_cacheremove(vp);
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>

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

210 if (lks == LK_SHARED)
211 vn_lock(vp, LK_DOWNGRADE | LK_RETRY);
212 return error;
213 }
214
215/* biosize = SSTOCN(smp->sm_share)->sc_txmax;*/
216 if (np->n_flag & NMODIFIED) {
217 smbfs_attr_cacheremove(vp);
218 error = VOP_GETATTR(vp, &vattr, cred, td);
218 error = VOP_GETATTR(vp, &vattr, cred);
219 if (error)
220 return error;
221 np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
222 } else {
219 if (error)
220 return error;
221 np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
222 } else {
223 error = VOP_GETATTR(vp, &vattr, cred, td);
223 error = VOP_GETATTR(vp, &vattr, cred);
224 if (error)
225 return error;
226 if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) {
227 error = smbfs_vinvalbuf(vp, td);
228 if (error)
229 return error;
230 np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
231 }

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

264 return error;
265 }
266 if (ioflag & IO_APPEND) {
267#ifdef notyet
268 /*
269 * File size can be changed by another client
270 */
271 smbfs_attr_cacheremove(vp);
224 if (error)
225 return error;
226 if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) {
227 error = smbfs_vinvalbuf(vp, td);
228 if (error)
229 return error;
230 np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
231 }

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

264 return error;
265 }
266 if (ioflag & IO_APPEND) {
267#ifdef notyet
268 /*
269 * File size can be changed by another client
270 */
271 smbfs_attr_cacheremove(vp);
272 error = VOP_GETATTR(vp, &vattr, cred, td);
272 error = VOP_GETATTR(vp, &vattr, cred);
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 != NULL) {

--- 431 unchanged lines hidden ---
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 != NULL) {

--- 431 unchanged lines hidden ---