smbd: move files_struct.lock_failure_seen to a bitfield
authorRalph Boehme <slow@samba.org>
Fri, 3 Apr 2020 07:48:58 +0000 (09:48 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 3 Apr 2020 20:41:34 +0000 (20:41 +0000)
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

source3/include/vfs.h
source3/smbd/blocking.c

index a6d0b2175181a1f5c177ce114719a08f070cc42f..d0151213b0e90dcf6d11527d9eeb084639cdd415 100644 (file)
 /* 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;
 
index eb219034a095bc4336b0789b3a45e25dc582fc02..a684c9e9043b7f2aba86d7dbf64481089ee93e94 100644 (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;
        }