From cd59805fd3c9537543ade63fed9e00b0d8793549 Mon Sep 17 00:00:00 2001 From: Nikolay Martynov Date: Wed, 16 Mar 2011 11:28:03 -0700 Subject: [PATCH] Fix inode generation so nautilus can count total dir size correctly --- source3/Makefile.in | 2 +- source3/include/proto.h | 1 + source3/lib/util.c | 13 ++----------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index 9f89808..ab7c530 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -398,7 +398,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \ lib/wins_srv.o \ lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \ lib/util_unistr.o lib/util_file.o \ - lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \ + lib/util.o lib/jenkins_hash.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \ lib/substitute.o lib/dbwrap_util.o \ lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \ lib/tallocmsg.o lib/dmallocmsg.o \ diff --git a/source3/include/proto.h b/source3/include/proto.h index ef80b92..a261310 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1179,6 +1179,7 @@ void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(void); const char *tab_depth(int level, int depth); int str_checksum(const char *s); +unsigned int jenkins_hash(TDB_DATA *key); void zero_free(void *p, size_t size); int set_maxfiles(int requested_max); int smb_mkstemp(char *name_template); diff --git a/source3/lib/util.c b/source3/lib/util.c index ee45da0..46be349 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1997,17 +1997,8 @@ const char *tab_depth(int level, int depth) int str_checksum(const char *s) { - int res = 0; - int c; - int i=0; - - while(*s) { - c = *s; - res ^= (c << (i % 15)) ^ (c >> (15-(i%15))); - s++; - i++; - } - return(res); + TDB_DATA key = string_tdb_data(s); + return jenkins_hash(&key); } /***************************************************************** -- 1.7.1