diff options
author | mohans <mohans@FreeBSD.org> | 2007-03-09 04:02:38 +0000 |
---|---|---|
committer | mohans <mohans@FreeBSD.org> | 2007-03-09 04:02:38 +0000 |
commit | a332cb00d57e6d307a6d08a69b4d5430b20c7850 (patch) | |
tree | 24b2e714c624eb1b06a4af38fe8eb04bc9f63660 /sys/nfsclient/nfsnode.h | |
parent | 088212ae5d87f38b2e7890e8e1a608a268db0add (diff) | |
download | FreeBSD-src-a332cb00d57e6d307a6d08a69b4d5430b20c7850.zip FreeBSD-src-a332cb00d57e6d307a6d08a69b4d5430b20c7850.tar.gz |
Over NFS, an open() call could result in multiple over-the-wire
GETATTRs being generated - one from lookup()/namei() and the other
from nfs_open() (for cto consistency). This change eliminates the
GETATTR in nfs_open() if an otw GETATTR was done from the namei()
path. Instead of extending the vop interface, we timestamp each attr
load, and use this to detect whether a GETATTR was done from namei()
for this syscall. Introduces a thread-local variable that counts the
syscalls made by the thread and uses <pid, tid, thread syscalls> as
the attrload timestamp. Thanks to jhb@ and peter@ for a discussion on
thread state that could be used as the timestamp with minimal overhead.
Diffstat (limited to 'sys/nfsclient/nfsnode.h')
-rw-r--r-- | sys/nfsclient/nfsnode.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index 2287235..f6d898a 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -74,6 +74,16 @@ struct nfsdmap { #define ndm_cookies ndm_un1.ndmu3_cookies #define ndm4_cookies ndm_un1.ndmu4_cookies +#define n_ac_ts_tid n_ac_ts.nfs_ac_ts_tid +#define n_ac_ts_pid n_ac_ts.nfs_ac_ts_pid +#define n_ac_ts_syscalls n_ac_ts.nfs_ac_ts_syscalls + +struct nfs_attrcache_timestamp { + lwpid_t nfs_ac_ts_tid; + pid_t nfs_ac_ts_pid; + unsigned long nfs_ac_ts_syscalls; +}; + /* * The nfsnode is the nfs equivalent to ufs's inode. Any similarity * is purely coincidental. @@ -127,6 +137,7 @@ struct nfsnode { uint32_t n_namelen; int n_directio_opens; int n_directio_asyncwr; + struct nfs_attrcache_timestamp n_ac_ts; }; #define n_atim n_un1.nf_atim |