summaryrefslogtreecommitdiffstats
path: root/source3/locking/locking.c
Commit message (Collapse)AuthorAgeFilesLines
* smbd: Factor out get_share_mode_write_time of get_file_infosVolker Lendecke2013-11-221-8/+11
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Factor out remove_stale_share_mode_entriesVolker Lendecke2013-10-151-0/+16
| | | | | | | Will be used in the next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Remove FAKE_LEVEL_II_OPLOCKVolker Lendecke2013-10-151-13/+1
| | | | | | | | | FAKE_LEVEL_II_OPLOCK was an indicator to break level2 oplock holders on write. This information is now being held in brlock.tdb, which makes the FAKE_LEVEL_II_OPLOCK type unnecessary. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify set_share_modeVolker Lendecke2013-10-081-30/+15
| | | | | | | | With the find_share_mode simplification we don't need fill_share_mode anymore. So this coalesces add_share_mode as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify find_share_mode_entry callersVolker Lendecke2013-10-081-46/+25
| | | | | | | | All callers used fill_share_mode_entry before calling find_share_mode_entry. Remove that requirement. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert set_share_mode to return bool for successVolker Lendecke2013-10-081-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make add_share_mode return boolVolker Lendecke2013-10-081-4/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Change parameter from unsigned to uint32_tVolker Lendecke2013-10-081-1/+1
| | | | | | | | share_mode_stale_pid internally only has to deal with uint32_t. Make the parameter match this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid calling serverid_exists twiceVolker Lendecke2013-10-061-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix a typoVolker Lendecke2013-09-111-1/+1
|
* smbd: Apply some const to find_share_mode_entryVolker Lendecke2013-09-061-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Apply some const to share_modes_identicalVolker Lendecke2013-09-061-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Simplify find_share_mode_entryVolker Lendecke2013-09-061-2/+5
| | | | | | | | There's no point checking the validity of the "entry" argument more than once Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Fix flawed share_mode_stale_pid APIVolker Lendecke2013-09-031-9/+26
| | | | | | | | | | | | | | | | The comment for this routine said: > Modifies d->num_share_modes, watch out in routines iterating over > that array. Well, it turns out that *every* caller of this API got it wrong. So I think it's better to change the routine. This leaves the array untouched while iterating but filters out the deleted ones while saving them back to disk. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Rename parameter "i" to "idx"Volker Lendecke2013-09-031-6/+6
| | | | | | | We'll need "i" in a later checkin ... :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke2013-04-261-61/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:locking: add mark_share_mode_disconnected()Stefan Metzmacher2012-09-081-0/+38
| | | | Pair-Programmed-With: Michael Adam <obnox@samba.org>
* Move copy_unix_token() from locking/locking.c to lib/util.c.Jeremy Allison2012-07-031-29/+0
| | | | Make public.
* s3:util: rename procid_equal() to serverid_equal()Michael Adam2012-06-211-3/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Remove a user of procid_is_meVolker Lendecke2012-06-211-1/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:locking: change locking.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-8/+8
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:include: change lock_struct->fnum to uint64_tMichael Adam2012-06-061-2/+2
| | | | | | | | | Note: this changes the format of brlock.tdb! Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Jun 6 23:22:00 CEST 2012 on sn-devel-104
* s3: Simplify get_delete_on_close_token moreVolker Lendecke2012-06-031-6/+2
| | | | | | All remaining callers actually want the token Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Simplify get_delete_on_close_token slightlyVolker Lendecke2012-06-031-19/+32
| | | | | | | Introduce find_delete_on_close_token. Thus is_delete_on_close_set does not have to call get_delete_on_close_token anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Avoid a lot of calls to serverid_exists()Volker Lendecke2012-06-011-1/+1
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Jun 1 18:58:30 CEST 2012 on sn-devel-104
* s3: Be less picky on stale share mode entriesVolker Lendecke2012-05-251-1/+3
| | | | | | | If a process died, the share mode entry might be bogus. Ignore those entries. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Check for serverid_exists in rename_share_filenameVolker Lendecke2012-05-251-0/+4
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Fix an invalid state only reachable on server crash/abort.Jeremy Allison2012-05-251-0/+11
| | | | | | | Remove any delete-on-close tokens and clear the count if there are no valid share modes. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Add "share_mode_stale_pid"Volker Lendecke2012-05-251-0/+32
| | | | | | | | This is a helper routine that prunes a dead share mode entry on demand. This prepares for removing the serverids_exist call in parse_share_modes. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Revert the serverid changes, they need more workVolker Lendecke2012-05-181-39/+1
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
* s3: Be less picky on stale share mode entriesVolker Lendecke2012-05-171-1/+3
| | | | | | If a process died, the share mode entry might be bogus. Ignore those entries. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Check for serverid_exists in rename_share_filenameVolker Lendecke2012-05-171-0/+4
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Add "share_mode_stale_server"Volker Lendecke2012-05-171-0/+32
| | | | | | | This is a helper routine that prunes a dead share mode entry on demand. This prepares for removing the serverids_exist call in parse_share_modes. Signed-off-by: Jeremy Allison <jra@samba.org>
* Found whilst back-porting the fix for bug 8837 - smbd crashes when deleting ↵Jeremy Allison2012-04-071-9/+10
| | | | | | | | | | | directory and veto files are enabled. The delete tokens are unique to each name hash representing a pathname, if we don't correctly return here we'll add duplicate tokens for a given pasname hash. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Apr 7 02:13:58 CEST 2012 on sn-devel-104
* Second part of bugfix for bug #8837 - smbd crashes when deleting directory ↵Jeremy Allison2012-04-041-8/+43
| | | | | | | and veto files are enabled. Store the 'struct security_token' as well as the 'struct security_unix_token' inside the locking db when setting a delete on close.
* s3: get_share_mode_lock_fresh->get_share_mode_lockVolker Lendecke2012-02-191-1/+1
| | | | | | | get_share_mode_lock_fresh is just a confusing name Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sun Feb 19 19:16:41 CET 2012 on sn-devel-104
* s3: get_share_mode_lock->get_existing_share_mode_lockVolker Lendecke2012-02-191-5/+5
|
* Add comments to all functions (to help me understand it better).Jeremy Allison2012-01-131-0/+5
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Jan 13 01:35:03 CET 2012 on sn-devel-104
* s3: Move the share_mode_lock handling to its own fileVolker Lendecke2012-01-121-415/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Put an indirection layer into share_mode_lockVolker Lendecke2012-01-121-133/+147
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Introduce get_share_mode_lock_fresh()Volker Lendecke2012-01-121-11/+19
| | | | | | | | This slightly simplifies the code path for all callers which assume that a share mode exists already. Only the callers in open_file_ntcreate and open_directory will ever create new share modes. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Replace fill_share_mode_lock()Volker Lendecke2012-01-121-84/+67
| | | | | | | | This replaces fill_share_mode_lock() with the two routines fresh_share_mode_lock() and parse_share_modes(). This lifts the decision whether a share mode already existed on level up. Signed-off-by: Jeremy Allison <jra@samba.org>
* Fix format warning message.Jeremy Allison2012-01-061-1/+1
|
* s3: Fix a 64-bit warningVolker Lendecke2011-12-251-1/+1
|
* s3:locking: avoid using sconn_server_id()Stefan Metzmacher2011-12-161-6/+6
| | | | metze
* s3: Fix a typoVolker Lendecke2011-12-151-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Dec 15 23:35:28 CET 2011 on sn-devel-104
* s3: Remove UNUSED_SHARE_MODE_ENTRYVolker Lendecke2011-12-141-44/+19
|
* s3: Move can_set_delete_on_close to smbd/Volker Lendecke2011-12-131-59/+0
|
* s3: Use talloc_tos() in set_write_time()Volker Lendecke2011-12-131-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 13 15:44:58 CET 2011 on sn-devel-104
* s3: Use talloc_tos() in set_sticky_write_time()Volker Lendecke2011-12-131-1/+1
|