summaryrefslogtreecommitdiff
path: root/source3/smbd/notify.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-04-14 20:39:14 +0200
committerVolker Lendecke <vl@samba.org>2009-04-16 15:07:06 +0200
commit32a36e470333abae2745e27074a24ab54777b41e (patch)
tree48c56c9ea94b63dd69b19d0ce348dda4a0bb679c /source3/smbd/notify.c
parentea3a022ca3ed97f0ac3f16536832e8ec43683f8c (diff)
downloadsamba-32a36e470333abae2745e27074a24ab54777b41e.tar.gz
samba-32a36e470333abae2745e27074a24ab54777b41e.tar.bz2
samba-32a36e470333abae2745e27074a24ab54777b41e.zip
Add notify_onelevel.tdb
This optimizes non-recursive notifys. For non-recursive notifies we can use a per-directory file-id indexed notify record. This matters for the Windows Explorer and IIS cases which do not use recursive notifies. In these cases, we do not have to shuffle around the whole notify record on every change. For the cluster case, this improves correctness of the notifies, ctdb only distributes the tdb seqnum once a second, so we can lose notifies.
Diffstat (limited to 'source3/smbd/notify.c')
-rw-r--r--source3/smbd/notify.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index d141fb2180..12a75cc9f6 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -339,6 +339,9 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
const char *path)
{
char *fullpath;
+ char *parent;
+ const char *name;
+ SMB_STRUCT_STAT sbuf;
if (path[0] == '.' && path[1] == '/') {
path += 2;
@@ -348,6 +351,13 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
return;
}
+ if (parent_dirname(talloc_tos(), path, &parent, &name)
+ && (SMB_VFS_STAT(conn, parent, &sbuf) != -1)) {
+ notify_onelevel(conn->notify_ctx, action, filter,
+ SMB_VFS_FILE_ID_CREATE(conn, &sbuf),
+ name);
+ }
+
notify_trigger(conn->notify_ctx, action, filter, fullpath);
SAFE_FREE(fullpath);
}