1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

38 Commits

Author SHA1 Message Date
Volker Lendecke
0d4f7bfdb9 s3:locking: Rename share_mode_forall->share_entry_forall
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-31 03:47:40 +01:00
Volker Lendecke
1057240733 brlock: Do auto-cleanup at conflict time
This avoids the need to do sweeping validate_lock_entries calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-23 00:24:18 +02:00
Volker Lendecke
188017ea32 smbd: Simplify brl_locktest
Pass "struct lock_struct" as a parameter. This had to be destructured
before the call and re-constructed inside brl_locktest.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-22 15:32:39 +02:00
Volker Lendecke
085c7a71fd smbd: do_lock_cancel does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul  4 08:52:31 CEST 2014 on sn-devel-104
2014-07-04 08:52:31 +02:00
Volker Lendecke
5a1fb2eb0d smbd: brl_lock_cancel does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
f038cf739d smbd: do_lock does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
c886e66232 smbd: brl_lock does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
c416b34648 smbd: Explicitly pass "file_id" to rename_share_filename
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-21 19:20:17 +01:00
Volker Lendecke
80e6ca5625 smbd: Factor out get_share_mode_write_time of get_file_infos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 13:30:27 -08:00
Volker Lendecke
c938a1065f smbd: Factor out remove_stale_share_mode_entries
Will be used in the next commit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15 23:46:11 +02:00
Volker Lendecke
eb50c18c4a smbd: Put "have_read_oplocks" into brlock.tdb
This implements an idea by metze: Right now Samba does not grant level2
oplocks where it should: After an initial no-oplock open that has been
written to, we don't have the FAKE_LEVEL2_OPLOCK entry in locking.tdb
around anymore, this downgraded to NO_OPLOCK. Windows in this case will
grant level2 if being asked, we don't.  Part of the reason for this
is that we don't have a proper mechanism to communicate the fact that
level2 needs to be broken to other smbds. Metze's insight was that we
have to look into brlock.tdb for every write anyway, so this might be
the right place to store this information.

My first reaction was that this is really hackish, but on further thought
this is not. oplocks depend on brlocks anyway, and we have the proper
mechanisms in place for brlocks.

The format for this change is to add one byte to the end of the brlock.tdb
record with value 1 if we have level2 oplocks around. Thus this patch
effectively reverts 8f41142 which I discovered while writing this
change. We now legally have unaligned records.

We can certainly talk about the format, but I'm not yet convinced we
need an idl for this yet. This is a potentially very hot code path,
and ndr marshalling has a cost.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 01:52:29 +02:00
Volker Lendecke
e0e5f67da5 smbd: Convert set_share_mode to return bool for success
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08 14:42:25 -07:00
Volker Lendecke
f9554a993e smbd: Change parameter from unsigned to uint32_t
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>
2013-10-08 14:42:02 -07:00
Volker Lendecke
07948ef6e1 smbd: Add brl_fsp access function 2013-09-11 08:27:11 +02:00
Volker Lendecke
6bcfc1a9da smbd: Add brl_num_locks access function 2013-09-11 08:27:11 +02:00
Volker Lendecke
2aa684453a smbd: Make brl_lock_failed static 2013-09-11 08:27:11 +02:00
Volker Lendecke
cca8faa621 smbd: Make brl_same_context static 2013-09-11 08:27:11 +02:00
Volker Lendecke
5006db98aa smbd: Rename parameter "i" to "idx"
We'll need "i" in a later checkin ... :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-03 17:13:53 +02:00
Volker Lendecke
a7e803485d smbd: We don't use DEFERRED_OPEN_ENTRY anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Gregor Beck
f608bedfca s3:locking: add function share_mode_cleanup_disconnected()
For a given file, clean share mode entries for a given persistent file id.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:13 +02:00
Gregor Beck
3d3e7e837a s3:locking: no need to make a file_id passed by value a constant
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:13 +02:00
Gregor Beck
ee81a6e7d0 s3:locking:brlock: add function brl_cleanup_disconnected()
For a given file, clean up brl entries belonging to a given persistent file id.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Stefan Metzmacher
f0a5b791ae s3:locking: add brl_mark_disconnected() and brl_reconnect_disconnected()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08 03:39:06 +02:00
Stefan Metzmacher
9a81f8ee17 s3:locking: add mark_share_mode_disconnected()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08 03:39:06 +02:00
Volker Lendecke
89b2eb1d06 s3: Make reduce_windows_lock_ref_count static
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:49 +02:00
Volker Lendecke
5842d4e025 s3: Add "share_mode_stale_pid"
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>
2012-05-25 09:19:37 -07:00
Volker Lendecke
f5ca3f11e4 s3: Revert the serverid changes, they need more work
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-18 13:12:14 +02:00
Volker Lendecke
f45966d169 s3: Add "share_mode_stale_server"
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>
2012-05-17 13:17:21 -07:00
Jeremy Allison
c10ed730d4 Second part of bugfix for bug #8837 - smbd crashes when deleting directory 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.
2012-04-04 14:58:42 -07:00
Volker Lendecke
f217faef1a s3: get_share_mode_lock_fresh->get_share_mode_lock
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
2012-02-19 19:16:41 +01:00
Volker Lendecke
e5c8484073 s3: get_share_mode_lock->get_existing_share_mode_lock 2012-02-19 17:44:26 +01:00
Volker Lendecke
9cf6d735d4 s3: Introduce get_share_mode_lock_fresh()
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>
2012-01-12 23:59:22 +01:00
Volker Lendecke
f7e84f2809 s3: Remove UNUSED_SHARE_MODE_ENTRY 2011-12-14 17:34:21 +01:00
Stefan Metzmacher
2e0bc74a6e s3:smbd: remove brl_register_msgs()
metze
2011-12-14 12:00:06 +01:00
Volker Lendecke
34d58c9d92 s3: Move can_set_delete_on_close to smbd/ 2011-12-13 17:27:26 +01:00
Michael Adam
ff82f77796 s3:locking/proto.h: add _LOCKING_PROTO_H_ guard 2011-05-31 01:44:27 +02:00
Michael Adam
93b8e90b5b s3:locking/proto.h: add GPL/Copyright header 2011-05-31 01:44:27 +02:00
Günther Deschner
2377039738 s3-locking: move locking prototypes out of proto.h.
Will later become part of locking.h

Guenther
2011-03-30 01:13:09 +02:00