From 021e2d01e68714556bd811ff2bc2a04c71a6c1fd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 10 Aug 2019 15:01:00 +0200 Subject: smbd: Move is_same_lease() up in the file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The next commit will need it there Signed-off-by: Volker Lendecke Reviewed-by: Ralph Böhme --- source3/smbd/open.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d889faedb44..262143fcdab 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1829,6 +1829,23 @@ static bool validate_oplock_types(struct share_mode_lock *lck) return true; } +static bool is_same_lease(const files_struct *fsp, + const struct share_mode_entry *e, + const struct smb2_lease *lease) +{ + if (e->op_type != LEASE_OPLOCK) { + return false; + } + if (lease == NULL) { + return false; + } + + return smb2_lease_equal(fsp_client_guid(fsp), + &lease->lease_key, + &e->client_guid, + &e->lease_key); +} + static bool delay_for_oplock(files_struct *fsp, int oplock_request, const struct smb2_lease *lease, @@ -2164,23 +2181,6 @@ static NTSTATUS grant_fsp_lease(struct files_struct *fsp, return status; } -static bool is_same_lease(const files_struct *fsp, - const struct share_mode_entry *e, - const struct smb2_lease *lease) -{ - if (e->op_type != LEASE_OPLOCK) { - return false; - } - if (lease == NULL) { - return false; - } - - return smb2_lease_equal(fsp_client_guid(fsp), - &lease->lease_key, - &e->client_guid, - &e->lease_key); -} - static int map_lease_type_to_oplock(uint32_t lease_type) { int result = NO_OPLOCK; -- cgit v1.2.1