svn commit: samba r24813 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

jra at samba.org jra at samba.org
Thu Aug 30 23:07:11 GMT 2007


Author: jra
Date: 2007-08-30 23:07:10 +0000 (Thu, 30 Aug 2007)
New Revision: 24813

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24813

Log:
Reformat to 80 columns.
Jeremy.

Modified:
   branches/SAMBA_3_2/source/smbd/statcache.c
   branches/SAMBA_3_2_0/source/smbd/statcache.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/statcache.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/statcache.c	2007-08-30 22:25:59 UTC (rev 24812)
+++ branches/SAMBA_3_2/source/smbd/statcache.c	2007-08-30 23:07:10 UTC (rev 24813)
@@ -1,21 +1,21 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    stat cache code
    Copyright (C) Andrew Tridgell 1992-2000
    Copyright (C) Jeremy Allison 1999-2004
    Copyright (C) Andrew Bartlett <abartlet at samba.org> 2003
    Copyright (C) Volker Lendecke 2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -33,14 +33,15 @@
  *
  * @param full_orig_name       The original name as specified by the client
  * @param orig_translated_path The name on our filesystem.
- * 
- * @note Only the first strlen(orig_translated_path) characters are stored 
+ *
+ * @note Only the first strlen(orig_translated_path) characters are stored
  *       into the cache.  This means that full_orig_name will be internally
  *       truncated.
  *
  */
 
-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 @@
 
 	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;
 		}
@@ -127,15 +132,20 @@
 	/*
 	 * New entry or replace old entry.
 	 */
-  
+
 	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 @@
  *                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.
  *
  */
 
@@ -170,7 +182,7 @@
 
 	if (!lp_stat_cache())
 		return False;
- 
+
 	name = *pname;
 	namelen = strlen(name);
 
@@ -217,7 +229,8 @@
 			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.
 		 */
@@ -348,7 +361,7 @@
  The function returns the bucket index number for the hashed key.
  JRA. Use a djb-algorithm hash for speed.
 ***************************************************************/
-                                                                                                     
+
 unsigned int fast_string_hash(TDB_DATA *key)
 {
         unsigned int n = 0;
@@ -374,7 +387,7 @@
 
 	/* 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;

Modified: branches/SAMBA_3_2_0/source/smbd/statcache.c
===================================================================
--- branches/SAMBA_3_2_0/source/smbd/statcache.c	2007-08-30 22:25:59 UTC (rev 24812)
+++ branches/SAMBA_3_2_0/source/smbd/statcache.c	2007-08-30 23:07:10 UTC (rev 24813)
@@ -1,21 +1,21 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    stat cache code
    Copyright (C) Andrew Tridgell 1992-2000
    Copyright (C) Jeremy Allison 1999-2004
    Copyright (C) Andrew Bartlett <abartlet at samba.org> 2003
    Copyright (C) Volker Lendecke 2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -33,14 +33,15 @@
  *
  * @param full_orig_name       The original name as specified by the client
  * @param orig_translated_path The name on our filesystem.
- * 
- * @note Only the first strlen(orig_translated_path) characters are stored 
+ *
+ * @note Only the first strlen(orig_translated_path) characters are stored
  *       into the cache.  This means that full_orig_name will be internally
  *       truncated.
  *
  */
 
-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 @@
 
 	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;
 		}
@@ -127,15 +132,20 @@
 	/*
 	 * New entry or replace old entry.
 	 */
-  
+
 	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 @@
  *                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.
  *
  */
 
@@ -170,7 +182,7 @@
 
 	if (!lp_stat_cache())
 		return False;
- 
+
 	name = *pname;
 	namelen = strlen(name);
 
@@ -217,7 +229,8 @@
 			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.
 		 */
@@ -348,7 +361,7 @@
  The function returns the bucket index number for the hashed key.
  JRA. Use a djb-algorithm hash for speed.
 ***************************************************************/
-                                                                                                     
+
 unsigned int fast_string_hash(TDB_DATA *key)
 {
         unsigned int n = 0;
@@ -374,7 +387,7 @@
 
 	/* 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;



More information about the samba-cvs mailing list