summaryrefslogtreecommitdiffstats
path: root/source3/smbd/notify_internal.c
Commit message (Collapse)AuthorAgeFilesLines
* smbd: Pass on a timestamp in MSG_PVFS_NOTIFYVolker Lendecke2014-04-231-34/+33
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass timespec_current through the notify_callbackVolker Lendecke2014-04-231-3/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open_tdb()Michael Adam2014-02-071-1/+1
| | | | | | | | ...for consistency and in preparation of future flags that the tdb backend might be aware of. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-071-1/+1
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix a typoVolker Lendecke2013-11-271-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Remove an optimization that became unnecessaryVolker Lendecke2013-03-261-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
* smbd: We don't collect our own vnn anymoreVolker Lendecke2013-03-261-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>
* smbd: Slightly simplify notify_triggerVolker Lendecke2013-03-261-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>
* smbd: Slightly simplify notify_triggerVolker Lendecke2013-03-261-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>
* smbd: Avoid some talloc_realloc in notify_internalVolker Lendecke2013-03-261-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>
* smbd: Avoid sending 0-sized keys to dbwrapVolker Lendecke2013-03-261-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>
* smbd: Fix a typoVolker Lendecke2013-03-141-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
* s3:smbd: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-191-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: fix compiler warnings in notify_internal.cStefan Metzmacher2012-07-261-3/+5
| | | | metze
* s3-param: Rename loadparm_s3_context -> loadparm_s3_helpersAndrew Bartlett2012-06-271-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
* s3:util: rename procid_equal() to serverid_equal()Michael Adam2012-06-211-1/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd fix some compiler warningsChristian Ambach2012-05-081-2/+2
|
* s3: Fix Coverity ID 2747: FORWARD_NULLVolker Lendecke2012-04-191-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.
* s3: Fix Coverity ID 2749: REVERSE_INULLVolker Lendecke2012-04-191-1/+3
|
* s3-dbwrap: push lp_ctx up another layer in the stackAndrew Bartlett2012-04-181-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
* s3: New notify implementationVolker Lendecke2012-04-171-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
* s3: Remove the sys_notify dependency from notify_internalVolker Lendecke2012-03-231-32/+0
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Mar 23 12:12:51 CET 2012 on sn-devel-104
* s3: Remove "conn" param from notify_init()Volker Lendecke2012-03-211-6/+1
|
* s3: Remove "conn" param from sys_notify_context_createVolker Lendecke2012-03-211-1/+1
|
* s3: Pass "conn" to sys_notify_watch()Volker Lendecke2012-03-211-1/+2
|
* s3: Pass "conn" to notify_add()Volker Lendecke2012-03-211-1/+2
|
* s3: Pass "path" through vfs_notify_watchVolker Lendecke2012-03-211-1/+1
|
* s3-notify: Lift "/." handling up one levelVolker Lendecke2012-03-161-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
* s3-notify: Simplify if-expressionsVolker Lendecke2012-03-161-16/+13
|
* s3: Use talloc_tos() in notify_send()Volker Lendecke2012-03-151-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
* s3: Fix lock ordering in notify_addVolker Lendecke2012-03-151-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>
* s3: properly free the notify_onelevel recordVolker Lendecke2012-03-151-1/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Replace some callers of cluster_id_equalVolker Lendecke2012-03-151-4/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Remove the separate server_id arg to notify_initVolker Lendecke2012-03-151-2/+2
| | | | | | The server_id is tied to the messaging_context Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Fix blank line endingsVolker Lendecke2012-03-151-13/+13
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Thu Mar 15 10:59:46 CET 2012 on sn-devel-104
* tdb_wrap: Move to specific directory.Jelmer Vernooij2012-03-101-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
* s3: Add a "lock_order" argument to db_openVolker Lendecke2012-01-181-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.
* lib/util: Add back control of mmap and hash size in tdb for top level buildAndrew Bartlett2011-10-131-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
* s3:smbd: convert notify db to use dbwrap wrapper functionsMichael Adam2011-10-111-28/+30
| | | | Avoid direct use of the db_record and db_context structs.
* s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam2011-07-291-1/+1
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
* s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam2011-07-291-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.
* tdb_compat: Higher level API fixes.Rusty Russell2011-06-201-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>
* s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett2011-06-091-2/+2
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* lib/util Move source3 tdb_wrap_open() into the common code.Andrew Bartlett2011-05-061-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
* More simple const fixes.Jeremy Allison2011-05-051-1/+1
|
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-1/+0
| | | | Guenther
* s3-messages: only include messages.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther