summaryrefslogtreecommitdiff
path: root/source3/smbd/notify.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-03-21 12:18:09 +0100
committerVolker Lendecke <vl@samba.org>2012-03-21 14:26:06 +0100
commitf3fe53668f5f42123ab4d91de23ac4f16bf12733 (patch)
tree4a8d95b4c44e5424f20558669895ea1745e69f26 /source3/smbd/notify.c
parent7dcc2bf7af10c6bf5f714b43ca81083fa1bea0b9 (diff)
downloadsamba-f3fe53668f5f42123ab4d91de23ac4f16bf12733.tar.gz
samba-f3fe53668f5f42123ab4d91de23ac4f16bf12733.tar.bz2
samba-f3fe53668f5f42123ab4d91de23ac4f16bf12733.zip
s3: Move the notify_ctx to the smbd_server_connection
We only need one notify_ctx per smbd. The notify_array can become quite large. It's based on absolute paths, so there's no point in having a copy of the complete array in memory multiple times. Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Wed Mar 21 14:26:07 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/smbd/notify.c')
-rw-r--r--source3/smbd/notify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index 88e838ee17..8228c7597e 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -221,7 +221,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
e.subdir_filter = filter;
}
- status = notify_add(fsp->conn->notify_ctx, fsp->conn, &e,
+ status = notify_add(fsp->conn->sconn->notify_ctx, fsp->conn, &e,
notify_callback, fsp);
TALLOC_FREE(fullpath);
@@ -364,6 +364,7 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
const char *path)
{
+ struct notify_context *notify_ctx = conn->sconn->notify_ctx;
char *fullpath;
char *parent;
const char *name;
@@ -378,7 +379,7 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
smb_fname_parent.base_name = parent;
if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) {
- notify_onelevel(conn->notify_ctx, action, filter,
+ notify_onelevel(notify_ctx, action, filter,
SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
name);
}
@@ -390,7 +391,7 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
DEBUG(0, ("asprintf failed\n"));
return;
}
- notify_trigger(conn->notify_ctx, action, filter, fullpath);
+ notify_trigger(notify_ctx, action, filter, fullpath);
TALLOC_FREE(fullpath);
}