1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r24813: Reformat to 80 columns.

Jeremy.
This commit is contained in:
Jeremy Allison 2007-08-30 23:07:10 +00:00 committed by Gerald (Jerry) Carter
parent 0cdf046dae
commit c6c8f5a897

View File

@ -40,7 +40,8 @@ static TDB_CONTEXT *tdb_stat_cache;
*
*/
void stat_cache_add( const char *full_orig_name, const char *translated_path, BOOL case_sensitive)
void stat_cache_add( const char *full_orig_name, const char *translated_path,
BOOL case_sensitive)
{
size_t translated_path_length;
TDB_DATA data_val;
@ -111,8 +112,12 @@ void stat_cache_add( const char *full_orig_name, const char *translated_path, BO
if (original_path_length != translated_path_length) {
if (original_path_length < translated_path_length) {
DEBUG(0, ("OOPS - tried to store stat cache entry for weird length paths [%s] %lu and [%s] %lu)!\n",
original_path, (unsigned long)original_path_length, translated_path, (unsigned long)translated_path_length));
DEBUG(0, ("OOPS - tried to store stat cache entry "
"for weird length paths [%s] %lu and [%s] %lu)!\n",
original_path,
(unsigned long)original_path_length,
translated_path,
(unsigned long)translated_path_length));
SAFE_FREE(original_path);
return;
}
@ -131,11 +136,16 @@ void stat_cache_add( const char *full_orig_name, const char *translated_path, BO
data_val.dsize = translated_path_length + 1;
data_val.dptr = (uint8 *)translated_path;
if (tdb_store_bystring(tdb_stat_cache, original_path, data_val, TDB_REPLACE) != 0) {
DEBUG(0,("stat_cache_add: Error storing entry %s -> %s\n", original_path, translated_path));
if (tdb_store_bystring(tdb_stat_cache, original_path, data_val,
TDB_REPLACE) != 0) {
DEBUG(0,("stat_cache_add: Error storing entry %s -> %s\n",
original_path, translated_path));
} else {
DEBUG(5,("stat_cache_add: Added entry (%lx:size%x) %s -> %s\n",
(unsigned long)data_val.dptr, (unsigned int)data_val.dsize, original_path, translated_path));
(unsigned long)data_val.dptr,
(unsigned int)data_val.dsize,
original_path,
translated_path));
}
SAFE_FREE(original_path);
@ -149,10 +159,12 @@ void stat_cache_add( const char *full_orig_name, const char *translated_path, BO
* to be correct as far as the cache can tell us. We assume that
* it is a malloc'ed string, we free it if necessary.
* @param dirpath The path as far as the stat cache told us.
* @param start A pointer into name, for where to 'start' in fixing the rest of the name up.
* @param start A pointer into name, for where to 'start' in fixing the rest
* of the name up.
* @param psd A stat buffer, NOT from the cache, but just a side-effect.
*
* @return True if we translated (and did a scuccessful stat on) the entire name.
* @return True if we translated (and did a scuccessful stat on) the entire
* name.
*
*/
@ -217,7 +229,8 @@ BOOL stat_cache_lookup(connection_struct *conn, char **pname, char **dirpath,
break;
}
DEBUG(10,("stat_cache_lookup: lookup failed for name [%s]\n", chk_name ));
DEBUG(10,("stat_cache_lookup: lookup failed for name [%s]\n",
chk_name ));
/*
* Didn't find it - remove last component for next try.
*/
@ -374,7 +387,7 @@ BOOL reset_stat_cache( void )
/* Create the in-memory tdb using our custom hash function. */
tdb_stat_cache = tdb_open_ex("statcache", 1031, TDB_INTERNAL,
(O_RDWR|O_CREAT), 0644, NULL, fast_string_hash);
(O_RDWR|O_CREAT), 0644, NULL, fast_string_hash);
if (!tdb_stat_cache)
return False;