diff options
author | Ralph Boehme <slow@samba.org> | 2020-07-02 14:08:44 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-08-06 12:18:21 +0000 |
commit | fc4f71046908be6f7694642acb71845defc79fb6 (patch) | |
tree | b643337216ca4b127321403becf84e4f81b5bd6c | |
parent | 4d5312be9990410e782bcaa4532e1612820a5827 (diff) | |
download | samba-fc4f71046908be6f7694642acb71845defc79fb6.tar.gz |
smbd: inverse if/else logic in get_lease_type()
No change in behaviour.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(backported from commit e4328db1c94837a8ea5652971cea20055d3d24ff)
[slow@samba.org: take id from d as it's not passed as arg]
-rw-r--r-- | source3/smbd/oplock.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index fe88adc9806..16484bb3d9d 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -175,24 +175,24 @@ static void downgrade_file_oplock(files_struct *fsp) uint32_t get_lease_type(const struct share_mode_data *d, const struct share_mode_entry *e) { - if (e->op_type == LEASE_OPLOCK) { - NTSTATUS status; - uint32_t current_state; + NTSTATUS status; + uint32_t current_state; - status = leases_db_get( - &e->client_guid, - &e->lease_key, - &d->id, - ¤t_state, - NULL, /* breaking */ - NULL, /* breaking_to_requested */ - NULL, /* breaking_to_required */ - NULL, /* lease_version */ - NULL); /* epoch */ - SMB_ASSERT(NT_STATUS_IS_OK(status)); - return current_state; - } - return map_oplock_to_lease_type(e->op_type); + if (e->op_type != LEASE_OPLOCK) { + return map_oplock_to_lease_type(e->op_type); + } + + status = leases_db_get(&e->client_guid, + &e->lease_key, + &d->id, + ¤t_state, + NULL, /* breaking */ + NULL, /* breaking_to_requested */ + NULL, /* breaking_to_required */ + NULL, /* lease_version */ + NULL); /* epoch */ + SMB_ASSERT(NT_STATUS_IS_OK(status)); + return current_state; } /**************************************************************************** |