1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

smbd: move files_struct.lock_failure_seen to a bitfield

Updated comment in vfs.h explaining ABI change.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  3 20:41:34 UTC 2020 on sn-devel-184
This commit is contained in:
Ralph Boehme 2020-04-03 09:48:58 +02:00 committed by Jeremy Allison
parent 16a485d1be
commit 78e1492f21
2 changed files with 22 additions and 3 deletions

View File

@ -294,6 +294,25 @@
/* Version 43 - Remove deferred_close from struct files_struct */
/* Version 43 - Remove SMB_VFS_OPENDIR() */
/* Version 43 - Remove original_lcomp from struct smb_filename */
/* Version 43 - files_struct flags:
bool kernel_share_modes_taken
bool update_write_time_triggered
bool update_write_time_on_close
bool write_time_forced
bool can_lock
bool can_read
bool can_write
bool modified
bool is_directory
bool aio_write_behind
bool initial_delete_on_close
bool delete_on_close
bool is_sparse
bool backup_intent
bool use_ofd_locks
bool closing
bool lock_failure_seen
changed to bitfields. */
#define SMB_VFS_INTERFACE_VERSION 43
@ -374,6 +393,7 @@ typedef struct files_struct {
bool backup_intent : 1;
bool use_ofd_locks : 1;
bool closing : 1;
bool lock_failure_seen : 1;
} fsp_flags;
struct tevent_timer *update_write_time_event;
@ -444,7 +464,6 @@ typedef struct files_struct {
* SMB1 remembers lock failures and delays repeated blocking
* lock attempts on the same offset.
*/
bool lock_failure_seen;
uint64_t lock_failure_offset;
} files_struct;

View File

@ -167,7 +167,7 @@ static void smbd_smb1_do_locks_setup_timeout(
state->timeout = lp_lock_spin_time();
}
if ((fsp->lock_failure_seen) &&
if (fsp->fsp_flags.lock_failure_seen &&
(blocker->offset == fsp->lock_failure_offset)) {
/*
* Delay repeated lock attempts on the same
@ -652,7 +652,7 @@ NTSTATUS smbd_smb1_do_locks_recv(struct tevent_req *req)
DBG_DEBUG("Setting lock_failure_offset=%"PRIu64"\n",
blocker->offset);
fsp->lock_failure_seen = true;
fsp->fsp_flags.lock_failure_seen = true;
fsp->lock_failure_offset = blocker->offset;
return status;
}