summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-09-19 17:42:51 +0200
committerChristof Schmitt <cs@samba.org>2019-04-14 05:18:14 +0000
commita187b7ef8fe91d227aeda5a2d9d4400d43c9d4ef (patch)
treed63cc5ca813f381935171bf988ad3cc8bc05cbf1 /source3/locking
parentad413ce91b31697f60c31394004272bcd6418596 (diff)
downloadsamba-a187b7ef8fe91d227aeda5a2d9d4400d43c9d4ef.tar.gz
smbd: Remove share_mode_lease and the leases array from share_mode_entry
This also removes the temporary functions introduced during the patchset. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sun Apr 14 05:18:14 UTC 2019 on sn-devel-144
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c45
-rw-r--r--source3/locking/share_mode_lock.c1
2 files changed, 0 insertions, 46 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 7a70c33ed53..10e9606d134 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -672,7 +672,6 @@ static void remove_share_mode_lease(struct share_mode_data *d,
struct share_mode_entry *e)
{
uint16_t op_type;
- uint32_t lease_idx;
uint32_t i;
op_type = e->op_type;
@@ -689,9 +688,6 @@ static void remove_share_mode_lease(struct share_mode_data *d,
* it, remove it.
*/
- lease_idx = e->lease_idx;
- e->lease_idx = UINT32_MAX;
-
for (i=0; i<d->num_share_modes; i++) {
struct share_mode_entry *e2 = &d->share_modes[i];
@@ -716,18 +712,6 @@ static void remove_share_mode_lease(struct share_mode_data *d,
return;
}
- d->num_leases -= 1;
- d->leases[lease_idx] = d->leases[d->num_leases];
-
- /*
- * We changed the lease array. Fix all references to it.
- */
- for (i=0; i<d->num_share_modes; i++) {
- if (d->share_modes[i].lease_idx == d->num_leases) {
- d->share_modes[i].lease_idx = lease_idx;
- }
- }
-
{
NTSTATUS status;
@@ -853,37 +837,8 @@ bool set_share_mode(struct share_mode_lock *lck,
e->op_type = op_type;
if (op_type == LEASE_OPLOCK) {
- uint32_t i;
-
e->client_guid = *client_guid;
e->lease_key = *lease_key;
-
- /*
- * Need to set lease_idx. This is essentially
- * find_share_mode_lease(), but that will go away
- * soon. So don't add the dependency here.
- */
-
- for (i=0; i<d->num_leases; i++) {
- struct share_mode_lease *l = &d->leases[i];
-
- if (smb2_lease_equal(client_guid,
- lease_key,
- &l->client_guid,
- &l->lease_key)) {
- break;
- }
- }
-
- if (i == d->num_leases) {
- DBG_WARNING("lease not found\n");
- d->num_share_modes -= 1;
- return false;
- }
-
- e->lease_idx = i;
- } else {
- e->lease_idx = UINT32_MAX;
}
e->time.tv_sec = fsp->open_time.tv_sec;
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 5d0abfe548c..a20de67b34a 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -1011,7 +1011,6 @@ bool share_mode_cleanup_disconnected(struct file_id fid,
open_persistent_id);
data->num_share_modes = 0;
- data->num_leases = 0;
data->modified = true;
ret = true;