Deleted Added
sdiff udiff text old ( 33134 ) new ( 34961 )
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

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
37 * $Id: nfs_subs.c,v 1.50 1998/02/04 22:33:15 eivind Exp $
38 */
39
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45#include <sys/param.h>

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

553extern int getfh(struct proc *, struct getfh_args *, int *);
554struct nfssvc_args;
555extern int nfssvc(struct proc *, struct nfssvc_args *, int *);
556
557LIST_HEAD(nfsnodehashhead, nfsnode);
558
559int nfs_webnamei __P((struct nameidata *, struct vnode *, struct proc *));
560
561/*
562 * Create the header for an rpc request packet
563 * The hsiz is the size of the rest of the nfs request header.
564 * (just used to decide if a cluster is a good idea)
565 */
566struct mbuf *
567nfsm_reqh(vp, procid, hsiz, bposp)
568 struct vnode *vp;

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

1343 else
1344 np->n_size = vap->va_size;
1345 } else
1346 np->n_size = vap->va_size;
1347 vnode_pager_setsize(vp, (u_long)np->n_size);
1348 } else
1349 np->n_size = vap->va_size;
1350 }
1351 np->n_attrstamp = time.tv_sec;
1352 if (vaper != NULL) {
1353 bcopy((caddr_t)vap, (caddr_t)vaper, sizeof(*vap));
1354 if (np->n_flag & NCHG) {
1355 if (np->n_flag & NACC)
1356 vaper->va_atime = np->n_atim;
1357 if (np->n_flag & NUPD)
1358 vaper->va_mtime = np->n_mtim;
1359 }

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

1369int
1370nfs_getattrcache(vp, vaper)
1371 register struct vnode *vp;
1372 struct vattr *vaper;
1373{
1374 register struct nfsnode *np = VTONFS(vp);
1375 register struct vattr *vap;
1376
1377 if ((time.tv_sec - np->n_attrstamp) >= NFS_ATTRTIMEO(np)) {
1378 nfsstats.attrcache_misses++;
1379 return (ENOENT);
1380 }
1381 nfsstats.attrcache_hits++;
1382 vap = &np->n_vattr;
1383 if (vap->va_size != np->n_size) {
1384 if (vap->va_type == VREG) {
1385 if (np->n_flag & NMODIFIED) {

--- 710 unchanged lines hidden ---