From: Volker Lendecke Date: Wed, 25 Jul 2018 15:05:34 +0000 (+0200) Subject: smbd: Remove "share_mode_entry->lease" X-Git-Tag: ldb-1.5.0~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dffcde408008d2bbac8e796ea7ce770c7e97f63;p=thirdparty%2Fsamba.git smbd: Remove "share_mode_entry->lease" smbstatus was the only user, and this could be solved by adapting share_entry_forall. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Jul 27 01:42:31 CEST 2018 on sn-devel-144 --- diff --git a/source3/librpc/idl/open_files.idl b/source3/librpc/idl/open_files.idl index 8d652a9fa01..c07a903878e 100644 --- a/source3/librpc/idl/open_files.idl +++ b/source3/librpc/idl/open_files.idl @@ -61,7 +61,6 @@ interface open_files * to store this share_mode_entry on disk. */ [skip] boolean8 stale; - [ignore] share_mode_lease *lease; } share_mode_entry; typedef [public] struct { diff --git a/source3/locking/locking.c b/source3/locking/locking.c index e962fee89ab..208f7e2081d 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -713,7 +713,6 @@ static void remove_share_mode_lease(struct share_mode_data *d, for (i=0; inum_share_modes; i++) { if (d->share_modes[i].lease_idx == d->num_leases) { d->share_modes[i].lease_idx = lease_idx; - d->share_modes[i].lease = &d->leases[lease_idx]; } } @@ -816,14 +815,10 @@ bool set_share_mode(struct share_mode_lock *lck, struct files_struct *fsp, { struct share_mode_data *d = lck->data; struct share_mode_entry *tmp, *e; - struct share_mode_lease *lease = NULL; - if (lease_idx == UINT32_MAX) { - lease = NULL; - } else if (lease_idx >= d->num_leases) { + if ((lease_idx != UINT32_MAX) && + (lease_idx >= d->num_leases)) { return false; - } else { - lease = &d->leases[lease_idx]; } tmp = talloc_realloc(d, d->share_modes, struct share_mode_entry, @@ -844,7 +839,6 @@ bool set_share_mode(struct share_mode_lock *lck, struct files_struct *fsp, e->op_mid = mid; e->op_type = op_type; e->lease_idx = lease_idx; - e->lease = lease; e->time.tv_sec = fsp->open_time.tv_sec; e->time.tv_usec = fsp->open_time.tv_usec; e->share_file_id = fsp->fh->gen_id; diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index f62a3b4ff3d..9314735ceda 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -329,17 +329,7 @@ static struct share_mode_data *parse_share_modes(TALLOC_CTX *mem_ctx, */ for (i=0; inum_share_modes; i++) { - struct share_mode_entry *e = &d->share_modes[i]; - - e->stale = false; - e->lease = NULL; - if (e->op_type != LEASE_OPLOCK) { - continue; - } - if (e->lease_idx >= d->num_leases) { - continue; - } - e->lease = &d->leases[e->lease_idx]; + d->share_modes[i].stale = false; } d->modified = false; d->fresh = false; @@ -836,9 +826,7 @@ static int share_mode_traverse_fn(struct db_record *rec, void *_state) } for (i=0; inum_share_modes; i++) { - struct share_mode_entry *entry = &d->share_modes[i]; - entry->stale = false; /* [skip] in idl */ - entry->lease = &d->leases[entry->lease_idx]; + d->share_modes[i].stale = false; } if (DEBUGLEVEL > 10) {