#include "ctdbd_conn.h"
#include "../lib/util/util_pw.h"
#include "messages.h"
-#include <ccan/hash/hash.h>
#include "libcli/security/security.h"
#include "serverid.h"
#include "lib/sys_rw.h"
int str_checksum(const char *s)
{
+ TDB_DATA key;
if (s == NULL)
return 0;
- return hash(s, strlen(s), 0);
+
+ key = (TDB_DATA) { .dptr = discard_const_p(uint8_t, s),
+ .dsize = strlen(s) };
+
+ return tdb_jenkins_hash(&key);
}
/*****************************************************************
#include "smb_share_modes.h"
#include <tdb.h>
#include "librpc/gen_ndr/open_files.h"
-#include <ccan/hash/hash.h>
/* Database context handle. */
struct smbdb_ctx {
size_t sharepath_size = strlen(sharepath);
size_t filename_size = strlen(filename);
uint32_t name_hash;
+ TDB_DATA key;
*err = 0;
fullpath = (char *)malloc(sharepath_size + filename_size + 2);
fullpath[sharepath_size] = '/';
memcpy(&fullpath[sharepath_size + 1], filename, filename_size + 1);
- name_hash = hash(fullpath, strlen(fullpath) + 1, 0);
+ key = (TDB_DATA) { .dptr = (uint8_t *)fullpath,
+ .dsize = strlen(fullpath) + 1 };
+ name_hash = tdb_jenkins_hash(&key);
free(fullpath);
return name_hash;
}
#include "includes.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
-#include <ccan/hash/hash.h>
#include "util_tdb.h"
struct shadow_copy2_config {
number collision, but I can't see a better approach
without significant VFS changes
*/
+ TDB_DATA key = { .dptr = discard_const_p(uint8_t, fname),
+ .dsize = strlen(fname) };
uint32_t shash;
- shash = hash(fname, strlen(fname), 0) & 0xFF000000;
+ shash = tdb_jenkins_hash(&key) & 0xFF000000;
if (shash == 0) {
shash = 1;
}
#include "smbd/globals.h"
#include "libcli/security/security.h"
#include "util_tdb.h"
-#include <ccan/hash/hash.h>
#include "lib/util/bitmap.h"
#define FILE_HANDLE_OFFSET 0x1000
char tmpbuf[PATH_MAX];
char *fullpath, *to_free;
ssize_t len;
+ TDB_DATA key;
/* Set the hash of the full pathname. */
if (len == -1) {
return NT_STATUS_NO_MEMORY;
}
- *p_name_hash = hash(fullpath, len+1, 0);
+ key = (TDB_DATA) { .dptr = (uint8_t *)fullpath, .dsize = len+1 };
+ *p_name_hash = tdb_jenkins_hash(&key);
DEBUG(10,("file_name_hash: %s hash 0x%x\n",
fullpath,
#include "messages.h"
#include "lib/util/util_tdb.h"
#include "librpc/gen_ndr/ndr_smbXsrv.h"
-#include <ccan/hash/hash.h>
#include "serverid.h"
struct smbXsrv_open_table {
{
uint8_t buf[8+8+8];
uint32_t ret;
+ TDB_DATA key;
SBVAL(buf, 0, _open->global->open_persistent_id);
SBVAL(buf, 8, _open->global->open_volatile_id);
SBVAL(buf, 16, _open->global->open_time);
- ret = hash(buf, sizeof(buf), 0);
+ key = (TDB_DATA) { .dptr = buf, .dsize = sizeof(buf) };
+ ret = tdb_jenkins_hash(&key);
if (ret == 0) {
ret = 1;