diff options
author | Ralph Boehme <slow@samba.org> | 2020-07-02 14:08:44 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2020-07-02 15:25:31 +0000 |
commit | e4328db1c94837a8ea5652971cea20055d3d24ff (patch) | |
tree | 0862ce8242fa754bbbe1dc50dc46894407dec2db | |
parent | 383a2457bd6cbe0acd571a8d601f8bdc5365f0b4 (diff) | |
download | samba-e4328db1c94837a8ea5652971cea20055d3d24ff.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>
-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 2c4449b10b2..c63f97aac0a 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -171,24 +171,24 @@ static void downgrade_file_oplock(files_struct *fsp) uint32_t get_lease_type(const struct share_mode_entry *e, struct file_id id) { - 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, - &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, + &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; } /**************************************************************************** |