summaryrefslogtreecommitdiff
path: root/source3/smbd/notify_internal.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-26smbd: Remove an optimization that became unnecessaryVolker Lendecke1-7/+6
After we only collect nonlocal vnns in idx_state.vnns now, at this point we *know* we have something to send to a remote node. The previous code avoided the call to notify_push_remote_blob with an if-statement that has now become unnecessary. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Mar 26 13:16:39 CET 2013 on sn-devel-104
2013-03-26smbd: We don't collect our own vnn anymoreVolker Lendecke1-3/+0
notify_trigger_index_parser will not anymore add ourselves into the vnn list that it collects. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26smbd: Slightly simplify notify_triggerVolker Lendecke1-0/+4
We have a good chance that we did not collect any remote vnns. This avoids trying to walk the remote vnns altogether. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26smbd: Slightly simplify notify_triggerVolker Lendecke1-6/+5
This straightens the for-loop walking the path components slightly Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26smbd: Avoid some talloc_realloc in notify_internalVolker Lendecke1-6/+16
For the nonclustered case we will only ever have one vnn in notify_index.tdb. For this case, without this patch we did talloc_realloc when collecting vnns to be able to do the memcpy instead of explicit copy with a for-loop. This new code will partition the new vnns we see when parsing a notify_index.tdb record into ourselves and all foreign vnns, only really collecting the foreign ones in an array. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26smbd: Avoid sending 0-sized keys to dbwrapVolker Lendecke1-1/+8
Start the notification one level below /. Sharing and notifying / for changes is broken at this moment anyway. When sharing / and someone wants to get notified for changes under /usr, we store "//usr" as the notify_index key. So this patch does not break anything that is not broken today, and it avoids a bogus call to dbwrap_parse_records. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-14smbd: Fix a typoVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Mar 14 14:46:02 CET 2013 on sn-devel-104
2013-02-19s3:smbd: s/struct event_context/struct tevent_contextStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-07-26s3:smbd: fix compiler warnings in notify_internal.cStefan Metzmacher1-3/+5
metze
2012-06-27s3-param: Rename loadparm_s3_context -> loadparm_s3_helpersAndrew Bartlett1-1/+1
This helps clarify the role of this structure and wrapper function. The purpose here is to provide helper functions to the lib/param loadparm_context that point back at the s3 lp_ functions. This allows a struct loadparm_context to be passed to any point in the code, and always refer to the correct loadparm system. If this has not been set, the variables loaded in the lib/param code will be returned. As requested by Michael Adam. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
2012-06-21s3:util: rename procid_equal() to serverid_equal()Michael Adam1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-08s3:smbd fix some compiler warningsChristian Ambach1-2/+2
2012-04-19s3: Fix Coverity ID 2747: FORWARD_NULLVolker Lendecke1-1/+1
For the notify cleanup process we have a notify context without a messaging entry. We will never call notify_add/remove for this, but the code should protect against this.
2012-04-19s3: Fix Coverity ID 2749: REVERSE_INULLVolker Lendecke1-1/+3
2012-04-18s3-dbwrap: push lp_ctx up another layer in the stackAndrew Bartlett1-1/+4
This will allow db_open_tdb() to be called from common code, which may already have a loadparm context loaded. It also slowly moves the lp_ctx up the stack, as required to remove the library loop between smbconf and the registry. Andrew Bartlett
2012-04-17s3: New notify implementationVolker Lendecke1-715/+951
From notify_internal.c: /* * The notify database is split up into two databases: One * relatively static index db and the real notify db with the * volatile entries. */ This change is necessary to make notify scale better in a cluster
2012-03-23s3: Remove the sys_notify dependency from notify_internalVolker Lendecke1-32/+0
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 23 12:12:51 CET 2012 on sn-devel-104
2012-03-21s3: Remove "conn" param from notify_init()Volker Lendecke1-6/+1
2012-03-21s3: Remove "conn" param from sys_notify_context_createVolker Lendecke1-1/+1
2012-03-21s3: Pass "conn" to sys_notify_watch()Volker Lendecke1-1/+2
2012-03-21s3: Pass "conn" to notify_add()Volker Lendecke1-1/+2
2012-03-21s3: Pass "path" through vfs_notify_watchVolker Lendecke1-1/+1
2012-03-16s3-notify: Lift "/." handling up one levelVolker Lendecke1-15/+0
This slightly simplifies the code Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 16 14:28:44 CET 2012 on sn-devel-104
2012-03-16s3-notify: Simplify if-expressionsVolker Lendecke1-16/+13
2012-03-15s3: Use talloc_tos() in notify_send()Volker Lendecke1-6/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Mar 15 12:43:41 CET 2012 on sn-devel-104
2012-03-15s3: Fix lock ordering in notify_addVolker Lendecke1-13/+15
It's not necessary to keep the global notify record locked during the inotify and notify_onelevel.tdb operations. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15s3: properly free the notify_onelevel recordVolker Lendecke1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15s3: Replace some callers of cluster_id_equalVolker Lendecke1-4/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15s3: Remove the separate server_id arg to notify_initVolker Lendecke1-2/+2
The server_id is tied to the messaging_context Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15s3: Fix blank line endingsVolker Lendecke1-13/+13
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Thu Mar 15 10:59:46 CET 2012 on sn-devel-104
2012-03-10tdb_wrap: Move to specific directory.Jelmer Vernooij1-1/+1
It's a bit confusing to mix low-level and high-level libraries. We had multiple libraries in one directory, and there were have circular dependencies with other libraries outside that directory (in this case, samba-hostconfig). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
2012-01-18s3: Add a "lock_order" argument to db_openVolker Lendecke1-2/+4
This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
2011-10-13lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett1-2/+11
This passes down a struct loadparm_context to allow these parameters to be checked. This may be s3 or s4 context, allowing the #if _SAMBA_BUILD_ macro to go away safely. Andrew Bartlett
2011-10-11s3:smbd: convert notify db to use dbwrap wrapper functionsMichael Adam1-28/+30
Avoid direct use of the db_record and db_context structs.
2011-07-29s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam1-1/+1
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam1-0/+1
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and make the fallbacke implementation functoins non-static and create a dbwrap_private.h header file that contains their prototypes.
2011-06-20tdb_compat: Higher level API fixes.Rusty Russell1-1/+1
My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett1-2/+2
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-05-06s3: only include tdb headers where needed.Günther Deschner1-0/+1
Guenther
2011-05-06lib/util Move source3 tdb_wrap_open() into the common code.Andrew Bartlett1-0/+1
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett
2011-05-05More simple const fixes.Jeremy Allison1-1/+1
2011-03-30s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner1-1/+0
Guenther
2011-03-30s3-messages: only include messages.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3: include smbd/smbd.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2010-09-27Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison1-4/+4
TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
2010-09-26s3: Remove talloc_autofree_context() from notify_internal_parent_init()Volker Lendecke1-4/+3
2010-08-26s3-build: use dbwrap.h only where needed.Günther Deschner1-0/+1
Guenther
2010-05-18s3: Remove use of iconv_convenience.Jelmer Vernooij1-14/+9
2010-05-06s3: only include gen_ndr headers where needed.Günther Deschner1-0/+1
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther