Deleted Added
sdiff udiff text old ( 234742 ) new ( 235332 )
full compact
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

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 * from nfs_vnops.c 8.16 (Berkeley) 5/27/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 234742 2012-04-27 22:23:06Z rmacklem $");
37
38/*
39 * vnode op calls for Sun NFS version 2, 3 and 4
40 */
41
42#include "opt_kdtrace.h"
43#include "opt_inet.h"
44

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

508static int
509nfs_open(struct vop_open_args *ap)
510{
511 struct vnode *vp = ap->a_vp;
512 struct nfsnode *np = VTONFS(vp);
513 struct vattr vattr;
514 int error;
515 int fmode = ap->a_mode;
516
517 if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK)
518 return (EOPNOTSUPP);
519
520 /*
521 * For NFSv4, we need to do the Open Op before cache validation,
522 * so that we conform to RFC3530 Sec. 9.3.1.
523 */

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

599 (void) nfsrpc_close(vp, 0, ap->a_td);
600 return (error);
601 }
602 mtx_lock(&np->n_mtx);
603 np->n_flag |= NNONCACHE;
604 }
605 np->n_directio_opens++;
606 }
607 mtx_unlock(&np->n_mtx);
608 vnode_create_vobject(vp, vattr.va_size, ap->a_td);
609 return (0);
610}
611
612/*
613 * nfs close vnode op
614 * What an NFS client should do upon close after writing is a debatable issue.
615 * Most NFS clients push delayed writes to the server upon close, basically for

--- 2865 unchanged lines hidden ---