From fe1daad52ac2a242c3e29b3f658c2d99a2a211c5 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Thu, 27 Feb 2003 09:14:25 +0000 Subject: [PATCH] add SMBFS_ATTRTIMO for the attribute cache timeout, instead of magic number bump the timeout to 5s; eventually we'd want to do some heuristics similar to NFS, i.e. make the attribute cache timeout longer for files nor recently changed --- sys/fs/smbfs/smbfs_node.c | 9 +++++---- sys/fs/smbfs/smbfs_node.h | 8 +++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index dc2a3d9f2fe9..2d543e7675c0 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_node.c,v 1.13 2003/02/25 09:09:31 jdolecek Exp $ */ +/* $NetBSD: smbfs_node.c,v 1.14 2003/02/27 09:14:26 jdolecek Exp $ */ /* * Copyright (c) 2000-2001 Boris Popov @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.13 2003/02/25 09:09:31 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.14 2003/02/27 09:14:26 jdolecek Exp $"); #include #include @@ -319,12 +319,13 @@ smbfs_attr_cachelookup(struct vnode *vp, struct vattr *va) { struct smbnode *np = VTOSMB(vp); struct smbmount *smp = VTOSMBFS(vp); - int s, diff; + int s; + time_t diff; s = splclock(); diff = mono_time.tv_sec - np->n_attrage; splx(s); - if (diff > 2) /* XXX should be configurable */ + if (diff > SMBFS_ATTRTIMO) /* XXX should be configurable */ return ENOENT; va->va_type = vp->v_type; /* vnode type (for create) */ diff --git a/sys/fs/smbfs/smbfs_node.h b/sys/fs/smbfs/smbfs_node.h index 0d7c90b0fabf..22465fa75966 100644 --- a/sys/fs/smbfs/smbfs_node.h +++ b/sys/fs/smbfs/smbfs_node.h @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_node.h,v 1.6 2003/02/24 21:52:53 jdolecek Exp $ */ +/* $NetBSD: smbfs_node.h,v 1.7 2003/02/27 09:14:25 jdolecek Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -48,6 +48,8 @@ /*efine NNEW 0x0008*//* smb/vnode has been allocated */ #define NREFPARENT 0x0010 /* node holds parent from recycling */ +#define SMBFS_ATTRTIMO 5 /* Attribute cache timeout in sec */ + struct smbfs_fctx; struct smbnode { @@ -92,10 +94,6 @@ int smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp); #define smbfs_hash(x, y) hash32_strn((x), (y), HASH32_STR_INIT) -#ifndef __NetBSD__ -int smbfs_getpages(void *); -int smbfs_putpages(void *); -#endif int smbfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred); int smbfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag); void smbfs_attr_cacheenter(struct vnode *vp, struct smbfattr *fap);