From de728fa81ae549b496f2ff26ebb082092aae2204 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Jan 2005 21:01:58 +0000 Subject: r5063: Shamelessly steal the Samba4 logic (and some code :-) for directory evaluation. This stops us from reading the entire directory into memory at one go, and allows partial reads. It also keeps almost the same interface to the OpenDir/ReadDir etc. code (sorry James :-). Next I will optimise the findfirst with exact match code. This speeds up our interactive response for large directories, but not when a missing (ie. negative) findfirst is done. Jeremy (This used to be commit 0af1d2f6f24f238cb05e10d7d53dcd5b5e0f5f5d) --- source3/smbd/notify_hash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/smbd/notify_hash.c') diff --git a/source3/smbd/notify_hash.c b/source3/smbd/notify_hash.c index 843580f6ed..80e8fee54a 100644 --- a/source3/smbd/notify_hash.c +++ b/source3/smbd/notify_hash.c @@ -45,6 +45,7 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags, size_t remaining_len; size_t fullname_len; void *dp; + long offset; ZERO_STRUCTP(data); @@ -88,7 +89,8 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags, remaining_len = sizeof(full_name) - fullname_len - 1; p = &full_name[fullname_len]; - while ((fname = ReadDirName(dp))) { + offset = 0; + while ((fname = ReadDirName(dp, &offset))) { if(strequal(fname, ".") || strequal(fname, "..")) continue; -- cgit