diff options
author | Jeremy Allison <jra@samba.org> | 2007-01-19 21:46:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:19 -0500 |
commit | aacd16e7c4bea5018560eea09d55f2a6473be84d (patch) | |
tree | d78e8f338eddd47bb458cbc4f0f7e0b7091dd461 /source3/smbd/statcache.c | |
parent | cce97a9b50e6c022cc9eba3d97969c27ae7d106d (diff) | |
download | samba-aacd16e7c4bea5018560eea09d55f2a6473be84d.tar.gz samba-aacd16e7c4bea5018560eea09d55f2a6473be84d.tar.bz2 samba-aacd16e7c4bea5018560eea09d55f2a6473be84d.zip |
r20916: Add in the delete on close final fix - but only enabled
with -DDEVELOPER.
Jeremy.
(This used to be commit 7f817067a70930ee3502ea3373173e0c23733253)
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r-- | source3/smbd/statcache.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index b453fdd544..1a2b7a8237 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -285,6 +285,40 @@ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath, } } +/*************************************************************************** + Tell all smbd's to delete an entry. +**************************************************************************/ + +void send_stat_cache_delete_message(const char *name) +{ +#ifdef DEVELOPER + message_send_all(conn_tdb_ctx(), + MSG_SMB_STAT_CACHE_DELETE, + name, + strlen(name)+1, + True, + NULL); +#endif +} + +/*************************************************************************** + Delete an entry. +**************************************************************************/ + +void stat_cache_delete(const char *name) +{ + char *lname = strdup_upper(name); + + if (!lname) { + return; + } + DEBUG(10,("stat_cache_delete: deleting name [%s] -> %s\n", + lname, name )); + + tdb_delete_bystring(tdb_stat_cache, lname); + SAFE_FREE(lname); +} + /*************************************************************** Compute a hash value based on a string key value. The function returns the bucket index number for the hashed key. |