diff options
author | Jeremy Allison <jra@samba.org> | 2005-01-28 21:01:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:13 -0500 |
commit | de728fa81ae549b496f2ff26ebb082092aae2204 (patch) | |
tree | 3d3198f7422045cc496c9fc318f2c3ae98e11d8a /source3/smbd/notify_hash.c | |
parent | 575ff396254cc433b8b73a9d8d2e649dde9b364d (diff) | |
download | samba-de728fa81ae549b496f2ff26ebb082092aae2204.tar.gz samba-de728fa81ae549b496f2ff26ebb082092aae2204.tar.bz2 samba-de728fa81ae549b496f2ff26ebb082092aae2204.zip |
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)
Diffstat (limited to 'source3/smbd/notify_hash.c')
-rw-r--r-- | source3/smbd/notify_hash.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |