summaryrefslogtreecommitdiffstats
path: root/source3/smbd/statcache.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-19 02:58:24 +0000
committerJeremy Allison <jra@samba.org>2000-10-19 02:58:24 +0000
commitabf055046fe70842badc2a1904f2cd6966bafbf4 (patch)
treeb2a91ee1ae46bafba86d4791cd25f1efed62895f /source3/smbd/statcache.c
parent7b0a62c8cd9523df86f1d9aee3e3700f494a8e78 (diff)
downloadsamba-abf055046fe70842badc2a1904f2cd6966bafbf4.tar.gz
samba-abf055046fe70842badc2a1904f2cd6966bafbf4.tar.xz
samba-abf055046fe70842badc2a1904f2cd6966bafbf4.zip
Ok - this is a big patch - and it may break smbd a bit (although
I hope not). If you encounter strange file-serving behavior after this patch then back it out. I analysed our stat() usage and realised we were doing approx. 3 stat calls per open, and 2 per getattr/setattr. This patch should fix all that. It causes the stat struct returned from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT pointer) to be passed through into the open code. This should prevent the multiple stats that were being done so as not to violate layer encapsulation in the API's. Herb - if you could run a NetBench test with this code and do a padc/par syscall test and also run with the current 2.2.0 code and test the padc/par syscalls I'd appreciate it - you should find the number of stat calls reduced - not sure by how much. The patch depends on unix_convert() actually finding the file and returning a stat struct, or returning a zero'd out stat struct if the file didn't exist. I believe we can guarentee this to be the case - I just wasn't confident enough to make this an assertion before. Ok ok - I did write this whilst at the Miami conference..... sometimes you get a little free time at these things :-). Jeremy. (This used to be commit 66a5c05ec46b641224fbe01b30bd7e83571a2a1b)
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r--source3/smbd/statcache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index 8d756a1d46..8200c277b3 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -193,7 +193,7 @@ BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
scp = (stat_cache_entry *)(hash_elem->value);
DO_PROFILE_INC(statcache_hits);
trans_name = scp->names+scp->name_len+1;
- if(conn->vfs_ops.stat(conn,dos_to_unix(trans_name,False), pst) != 0) {
+ if(vfs_stat(conn,trans_name, pst) != 0) {
/* Discard this entry - it doesn't exist in the filesystem. */
hash_remove(&stat_cache, hash_elem);
return False;