The branch, master has been updated
       via  78e1492f218 smbd: move files_struct.lock_failure_seen to a bitfield
       via  16a485d1be3 smbd: move files_struct.closing to a bitfield
       via  e940a41c2b2 smbd: move files_struct.use_ofd_locks to a bitfield
       via  34b4effc04b smbd: move files_struct.backup_intent to a bitfield
       via  049488f6a51 smbd: move files_struct.is_sparse to a bitfield
       via  930b7525a66 smbd: move files_struct.delete_on_close to a bitfield
       via  b0824cf35fe smbd: move files_struct.initial_delete_on_close to a 
bitfield
       via  1ccd335af5d smbd: move files_struct.aio_write_behind to a bitfield
       via  cb996cd5a35 smbd: move files_struct.is_directory to a bitfield
       via  65a4302474d smbd: move files_struct.modified to a bitfield
       via  b95c62bc90c smbd: move files_struct.can_write to a bitfield
       via  8b48969241a smbd: move files_struct.can_read to a bitfield
       via  d22096961be smbd: move files_struct.can_lock to a bitfield
       via  4d70e92a917 smbd: move files_struct.write_time_forced to a bitfield
       via  9c2809c5175 smbd: move files_struct.update_write_time_on_close to a 
bitfield
       via  adaca9597ce smbd: move files_struct.update_write_time_triggered to 
a bitfield
       via  7c386c08dcc smbd: move files_struct.kernel_share_modes_taken to a 
bitfield
       via  fed1bc2293e smbd: reindent if expression in real_write_file()
       via  8718dae6b8a smbd: fix if expression that checks when to call 
vfs_fill_sparse()
       via  ea0f1b3be77 smbd: reformat an if expression in smbd_smb2_close()
       via  a72208fc8c9 smbd: reformat a function call in rename_internals_fsp()
       via  553e576ad97 smbd: reformat an if expression in reply_readbraw()
       via  5a5bbcd9d99 smbd: reformat calling 
ensure_canon_entry_valid_on_set() in unpack_canon_ace()
       via  574255a754a smbd: CHECK_WRITE macro reformatting
       via  2d56412e28b smbd: CHECK_READ_IOCTL macro reformatting
       via  be6f8e03a07 smbd: CHECK_READ_SMB2 macro reformatting
       via  61e3576ad85 smbd: CHECK_READ macro reformatting
      from  23349f9d2c2 selftest: Add list of tests to be ported

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 78e1492f218b94f1fd4085b20bc28bd84c8d6dc7
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 09:48:58 2020 +0200

    smbd: move files_struct.lock_failure_seen to a bitfield
    
    Updated comment in vfs.h explaining ABI change.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Fri Apr  3 20:41:34 UTC 2020 on sn-devel-184

commit 16a485d1be39f511a8d36c979e25aa0fcb1ce1b0
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 08:06:27 2020 +0200

    smbd: move files_struct.closing to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit e940a41c2b2a80087086e7bd63e36c410225b586
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 08:02:23 2020 +0200

    smbd: move files_struct.use_ofd_locks to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 34b4effc04b44e22809227479da2d794ac88e447
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 08:01:45 2020 +0200

    smbd: move files_struct.backup_intent to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 049488f6a51ffd151cf5588b59cc3784b80b7ba0
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 07:52:10 2020 +0200

    smbd: move files_struct.is_sparse to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 930b7525a669b96231c2bcd72bccf7e4aa4601ed
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 07:48:08 2020 +0200

    smbd: move files_struct.delete_on_close to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit b0824cf35feb893db9e7ec33aced8194279b1daf
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 07:43:38 2020 +0200

    smbd: move files_struct.initial_delete_on_close to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 1ccd335af5d6c6c16d9ab46102b506798bb283fa
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Apr 3 07:39:34 2020 +0200

    smbd: move files_struct.aio_write_behind to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit cb996cd5a3570e1cd6bf92776acd7c8cd22ebbfd
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 18:21:11 2020 +0200

    smbd: move files_struct.is_directory to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 65a4302474d1e6678ea6d258f981c4fc139aeeb4
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 17:37:02 2020 +0200

    smbd: move files_struct.modified to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit b95c62bc90cef5cbb5525c92788eca9641944268
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 17:28:32 2020 +0200

    smbd: move files_struct.can_write to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8b48969241ab62fb21bca21ef163c18300e962e6
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 17:18:43 2020 +0200

    smbd: move files_struct.can_read to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit d22096961be2dd8a41631484d87d3afadaec6ca0
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 17:09:36 2020 +0200

    smbd: move files_struct.can_lock to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4d70e92a917f738c9924bdbb0f51a24323a21494
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 15:39:32 2020 +0200

    smbd: move files_struct.write_time_forced to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9c2809c51756b9a92e1939ee388bec5108b00ef2
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 15:37:15 2020 +0200

    smbd: move files_struct.update_write_time_on_close to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit adaca9597ce38292e5db0fd7522d3cb4ac7e9bbb
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 15:31:10 2020 +0200

    smbd: move files_struct.update_write_time_triggered to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7c386c08dcc9e52b40f64034b6f726e477e04722
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Apr 1 11:59:10 2020 +0200

    smbd: move files_struct.kernel_share_modes_taken to a bitfield
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit fed1bc2293edd1f66d452140405aac5699da439b
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 10:29:15 2020 +0200

    smbd: reindent if expression in real_write_file()
    
    No change in behaviour.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8718dae6b8aee461c8207d14bf3d8d8361cab829
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 10:27:21 2020 +0200

    smbd: fix if expression that checks when to call vfs_fill_sparse()
    
    Noone complained so far, skip bugreport.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit ea0f1b3be7728c5cb5adec58bd85e74b872fce52
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 09:56:46 2020 +0200

    smbd: reformat an if expression in smbd_smb2_close()
    
    No change in behavour.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit a72208fc8c9baf07d2ed4fdb35897b130b7f9098
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 09:23:22 2020 +0200

    smbd: reformat a function call in rename_internals_fsp()
    
    No change in behaviour.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 553e576ad9715bec1f96f44598fc6a0813c6989d
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 09:13:56 2020 +0200

    smbd: reformat an if expression in reply_readbraw()
    
    No change in behaviour.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5a5bbcd9d99b64b7422d063ea6de7eea20d91f66
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Apr 2 08:16:33 2020 +0200

    smbd: reformat calling ensure_canon_entry_valid_on_set() in 
unpack_canon_ace()
    
    No change in behaviour.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 574255a754ab385b213a5ca73e26c8ad5292f249
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Apr 1 15:19:51 2020 +0200

    smbd: CHECK_WRITE macro reformatting
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 2d56412e28b5f1405f4048938c301a7b8e71ac09
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Apr 1 15:08:50 2020 +0200

    smbd: CHECK_READ_IOCTL macro reformatting
    
    A subsequent commit will replace can_read with something much longer.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit be6f8e03a07234f62834724868b8399b3e0345d8
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Apr 1 15:08:50 2020 +0200

    smbd: CHECK_READ_SMB2 macro reformatting
    
    A subsequent commit will replace can_read with something much longer.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 61e3576ad8531ceb9bef2b8cdac348fcc1d57ea8
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Apr 1 15:08:50 2020 +0200

    smbd: CHECK_READ macro reformatting
    
    A subsequent commit will replace can_read with something much longer.
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/include/smb_macros.h         | 19 ++++++++----
 source3/include/vfs.h                | 56 ++++++++++++++++++++++++------------
 source3/locking/locking.c            | 20 +++++++------
 source3/locking/posix.c              |  4 +--
 source3/modules/offload_token.c      |  8 +++---
 source3/modules/vfs_acl_common.c     |  3 +-
 source3/modules/vfs_afsacl.c         |  4 +--
 source3/modules/vfs_ceph_snapshots.c |  2 +-
 source3/modules/vfs_default.c        |  8 +++---
 source3/modules/vfs_fruit.c          |  5 ++--
 source3/modules/vfs_gpfs.c           |  6 ++--
 source3/modules/vfs_shadow_copy2.c   |  4 +--
 source3/modules/vfs_syncops.c        |  2 +-
 source3/modules/vfs_virusfilter.c    | 12 ++++----
 source3/printing/printspoolss.c      | 10 +++----
 source3/smbd/aio.c                   |  5 ++--
 source3/smbd/blocking.c              |  4 +--
 source3/smbd/close.c                 | 30 +++++++++----------
 source3/smbd/conn_idle.c             |  2 +-
 source3/smbd/dir.c                   |  2 +-
 source3/smbd/dosmode.c               |  6 ++--
 source3/smbd/durable.c               | 52 ++++++++++++++++++---------------
 source3/smbd/fake_file.c             |  2 +-
 source3/smbd/file_access.c           |  2 +-
 source3/smbd/fileio.c                | 26 +++++++++--------
 source3/smbd/files.c                 | 26 ++++++++---------
 source3/smbd/nttrans.c               | 14 ++++-----
 source3/smbd/open.c                  | 49 ++++++++++++++++---------------
 source3/smbd/pipes.c                 |  2 +-
 source3/smbd/posix_acls.c            | 51 +++++++++++++++++++++-----------
 source3/smbd/pysmbd.c                | 10 +++----
 source3/smbd/reply.c                 | 45 +++++++++++++++++------------
 source3/smbd/server_exit.c           |  2 +-
 source3/smbd/smb2_close.c            |  6 ++--
 source3/smbd/smb2_flush.c            |  4 +--
 source3/smbd/smb2_ioctl_filesys.c    |  6 ++--
 source3/smbd/smb2_lock.c             |  2 +-
 source3/smbd/smb2_notify.c           |  2 +-
 source3/smbd/smb2_query_directory.c  |  2 +-
 source3/smbd/smb2_read.c             |  2 +-
 source3/smbd/trans2.c                | 14 ++++-----
 source3/torture/cmd_vfs.c            | 22 +++++++-------
 42 files changed, 312 insertions(+), 241 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index 266c17427e8..702be07aacd 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -44,9 +44,11 @@
 #define IS_IPC(conn)       ((conn) && (conn)->ipc)
 #define IS_PRINT(conn)       ((conn) && (conn)->printer)
 
-#define CHECK_READ(fsp,req) (((fsp)->fh->fd != -1) && ((fsp)->can_read || \
-                       ((req->flags2 & FLAGS2_READ_PERMIT_EXECUTE) && \
-                        (fsp->access_mask & FILE_EXECUTE))))
+#define CHECK_READ(fsp,req) \
+       (((fsp)->fh->fd != -1) && \
+        (((fsp)->fsp_flags.can_read) || \
+         ((req->flags2 & FLAGS2_READ_PERMIT_EXECUTE) && \
+          (fsp->access_mask & FILE_EXECUTE))))
 
 /*
  * This is not documented in revision 49 of [MS-SMB2] but should be added in a
@@ -62,7 +64,8 @@
  */
 #define CHECK_READ_SMB2(fsp) \
        (((fsp)->fh->fd != -1) && \
-        ((fsp)->can_read || (fsp->access_mask & FILE_EXECUTE)))
+        (((fsp)->fsp_flags.can_read) || \
+         (fsp->access_mask & FILE_EXECUTE)))
 
 /* An IOCTL readability check (validating read access
  * when the IOCTL code requires it)
@@ -70,9 +73,13 @@
  * ). On Windows servers, this is done by the IO manager, which is unaware of
  * the "if execute is granted then also grant read" arrangement.
  */
-#define CHECK_READ_IOCTL(fsp) (((fsp)->fh->fd != -1) && ((fsp)->can_read))
+#define CHECK_READ_IOCTL(fsp) \
+       (((fsp)->fh->fd != -1) && \
+        (((fsp)->fsp_flags.can_read)))
 
-#define CHECK_WRITE(fsp) ((fsp)->can_write && ((fsp)->fh->fd != -1))
+#define CHECK_WRITE(fsp) \
+       ((fsp)->fsp_flags.can_write && \
+        ((fsp)->fh->fd != -1))
 
 #define ERROR_WAS_LOCK_DENIED(status) (NT_STATUS_EQUAL((status), 
NT_STATUS_LOCK_NOT_GRANTED) || \
                                NT_STATUS_EQUAL((status), 
NT_STATUS_FILE_LOCK_CONFLICT) )
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index fe315673823..d0151213b0e 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -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
 
@@ -357,13 +376,28 @@ typedef struct files_struct {
        uint64_t vuid; /* SMB2 compat */
        struct timeval open_time;
        uint32_t access_mask;           /* NTCreateX access bits 
(FILE_READ_DATA etc.) */
-       bool kernel_share_modes_taken;
+       struct {
+               bool kernel_share_modes_taken : 1;
+               bool update_write_time_triggered : 1;
+               bool update_write_time_on_close : 1;
+               bool write_time_forced : 1;
+               bool can_lock : 1;
+               bool can_read : 1;
+               bool can_write : 1;
+               bool modified : 1;
+               bool is_directory : 1;
+               bool aio_write_behind : 1;
+               bool initial_delete_on_close : 1;
+               bool delete_on_close : 1;
+               bool is_sparse : 1;
+               bool backup_intent : 1;
+               bool use_ofd_locks : 1;
+               bool closing : 1;
+               bool lock_failure_seen : 1;
+       } fsp_flags;
 
-       bool update_write_time_triggered;
        struct tevent_timer *update_write_time_event;
-       bool update_write_time_on_close;
        struct timespec close_write_time;
-       bool write_time_forced;
 
        int oplock_type;
 
@@ -380,19 +414,7 @@ typedef struct files_struct {
        struct lock_struct last_lock_failure;
        int current_lock_count; /* Count the number of outstanding locks and 
pending locks. */
 
-       bool can_lock;
-       bool can_read;
-       bool can_write;
-       bool modified;
-       bool is_directory;
-       bool aio_write_behind;
-       bool initial_delete_on_close; /* Only set at NTCreateX if file was 
created. */
-       bool delete_on_close;
        uint64_t posix_flags;
-       bool is_sparse;
-       bool backup_intent; /* Handle was successfully opened with backup intent
-                               and opener has privilege to do so. */
-       bool use_ofd_locks; /* Are we using open file description locks ? */
        struct smb_filename *fsp_name;
        uint32_t name_hash;             /* Jenkins hash of full pathname. */
        uint64_t mid;                   /* Mid of the operation that created 
us. */
@@ -429,7 +451,6 @@ typedef struct files_struct {
         */
        unsigned num_aio_requests;
        struct tevent_req **aio_requests;
-       bool closing;
 
        /*
         * Requests waiting for smb1 byte range locks. They are
@@ -443,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;
 
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 1220cb3a2be..f5426391c21 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -178,8 +178,10 @@ NTSTATUS query_lock(files_struct *fsp,
 {
        struct byte_range_lock *br_lck = NULL;
 
-       if (!fsp->can_lock) {
-               return fsp->is_directory ? NT_STATUS_INVALID_DEVICE_REQUEST : 
NT_STATUS_INVALID_HANDLE;
+       if (!fsp->fsp_flags.can_lock) {
+               return fsp->fsp_flags.is_directory ?
+                       NT_STATUS_INVALID_DEVICE_REQUEST :
+                       NT_STATUS_INVALID_HANDLE;
        }
 
        if (!lp_locking(fsp->conn->params)) {
@@ -306,8 +308,8 @@ NTSTATUS do_lock(files_struct *fsp,
                return NT_STATUS_OK;
        }
 
-       if (!fsp->can_lock) {
-               if (fsp->is_directory) {
+       if (!fsp->fsp_flags.can_lock) {
+               if (fsp->fsp_flags.is_directory) {
                        return NT_STATUS_INVALID_DEVICE_REQUEST;
                }
                return NT_STATUS_INVALID_HANDLE;
@@ -362,8 +364,10 @@ NTSTATUS do_unlock(files_struct *fsp,
        bool ok = False;
        struct byte_range_lock *br_lck = NULL;
 
-       if (!fsp->can_lock) {
-               return fsp->is_directory ? NT_STATUS_INVALID_DEVICE_REQUEST : 
NT_STATUS_INVALID_HANDLE;
+       if (!fsp->fsp_flags.can_lock) {
+               return fsp->fsp_flags.is_directory ?
+                       NT_STATUS_INVALID_DEVICE_REQUEST :
+                       NT_STATUS_INVALID_HANDLE;
        }
 
        if (!lp_locking(fsp->conn->params)) {
@@ -929,7 +933,7 @@ bool set_delete_on_close(files_struct *fsp, bool 
delete_on_close,
                reset_delete_on_close_lck(fsp, lck);
        }
 
-       if (fsp->is_directory) {
+       if (fsp->fsp_flags.is_directory) {
                SMB_ASSERT(!is_ntfs_stream_smb_fname(fsp->fsp_name));
                send_stat_cache_delete_message(fsp->conn->sconn->msg_ctx,
                                               fsp->fsp_name->base_name);
@@ -937,7 +941,7 @@ bool set_delete_on_close(files_struct *fsp, bool 
delete_on_close,
 
        TALLOC_FREE(lck);
 
-       fsp->delete_on_close = delete_on_close;
+       fsp->fsp_flags.delete_on_close = delete_on_close;
 
        return True;
 }
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index e74f48636ec..32f8317776e 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -51,7 +51,7 @@ static struct db_context *posix_pending_close_db;
 
 static int map_posix_lock_type( files_struct *fsp, enum brl_type lock_type)
 {
-       if((lock_type == WRITE_LOCK) && !fsp->can_write) {
+       if ((lock_type == WRITE_LOCK) && !fsp->fsp_flags.can_write) {
                /*
                 * Many UNIX's cannot get a write lock on a file opened 
read-only.
                 * Win32 locking semantics allow this.
@@ -585,7 +585,7 @@ int fd_close_posix(const struct files_struct *fsp)
 
        if (!lp_locking(fsp->conn->params) ||
            !lp_posix_locking(fsp->conn->params) ||
-           fsp->use_ofd_locks)
+           fsp->fsp_flags.use_ofd_locks)
        {
                /*
                 * No locking or POSIX to worry about or we are using POSIX
diff --git a/source3/modules/offload_token.c b/source3/modules/offload_token.c
index c562f1bab0b..e13806efe9a 100644
--- a/source3/modules/offload_token.c
+++ b/source3/modules/offload_token.c
@@ -270,23 +270,23 @@ NTSTATUS vfs_offload_token_check_handles(uint32_t fsctl,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if (src_fsp->closing) {
+       if (src_fsp->fsp_flags.closing) {
                DBG_INFO("copy chunk src handle with closing in progress.\n");
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if (dst_fsp->closing) {
+       if (dst_fsp->fsp_flags.closing) {
                DBG_INFO("copy chunk dst handle with closing in progress.\n");
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if (src_fsp->is_directory) {
+       if (src_fsp->fsp_flags.is_directory) {
                DBG_INFO("copy chunk no read on src directory handle (%s).\n",
                         smb_fname_str_dbg(src_fsp->fsp_name));
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if (dst_fsp->is_directory) {
+       if (dst_fsp->fsp_flags.is_directory) {
                DBG_INFO("copy chunk no read on dst directory handle (%s).\n",
                         smb_fname_str_dbg(dst_fsp->fsp_name));
                return NT_STATUS_ACCESS_DENIED;
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 35dc82ee11d..7bed255d390 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1137,7 +1137,8 @@ static int acl_common_remove_object(vfs_handle_struct 
*handle,
        for (fsp = file_find_di_first(conn->sconn, id); fsp;
                     fsp = file_find_di_next(fsp)) {
                if (fsp->access_mask & DELETE_ACCESS &&
-                               fsp->delete_on_close) {
+                   fsp->fsp_flags.delete_on_close)
+               {
                        /* We did open this for delete,
                         * allow the delete as root.
                         */
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c
index 40071c85431..e4b99fdcf93 100644
--- a/source3/modules/vfs_afsacl.c
+++ b/source3/modules/vfs_afsacl.c
@@ -930,7 +930,7 @@ static NTSTATUS afs_set_nt_acl(vfs_handle_struct *handle, 
files_struct *fsp,
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!fsp->is_directory) {
+       if (!fsp->fsp_flags.is_directory) {
                /* We need to get the name of the directory containing the
                 * file, this is where the AFS acls live */
                char *p = strrchr(name, '/');
@@ -951,7 +951,7 @@ static NTSTATUS afs_set_nt_acl(vfs_handle_struct *handle, 
files_struct *fsp,
 
        split_afs_acl(&old_afs_acl, &dir_acl, &file_acl);
 
-       if (fsp->is_directory) {
+       if (fsp->fsp_flags.is_directory) {
 
                if (!strequal(fileacls, "yes")) {
                        /* Throw away file acls, we depend on the
diff --git a/source3/modules/vfs_ceph_snapshots.c 
b/source3/modules/vfs_ceph_snapshots.c
index 7af9ff655c1..2b625843187 100644
--- a/source3/modules/vfs_ceph_snapshots.c
+++ b/source3/modules/vfs_ceph_snapshots.c
@@ -380,7 +380,7 @@ static int ceph_snap_get_shadow_copy_data(struct 
vfs_handle_struct *handle,
                goto err_out;
        }
 
-       if (fsp->is_directory) {
+       if (fsp->fsp_flags.is_directory) {
                parent_dir = fsp->fsp_name->base_name;
        } else {
                ret = ceph_snap_get_parent_path(handle->conn->connectpath,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index ca1f000143a..2a7e04f79d1 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2633,7 +2633,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, 
files_struct *fsp, off_t
 
        START_PROFILE(syscall_ftruncate);
 
-       if (lp_strict_allocate(SNUM(fsp->conn)) && !fsp->is_sparse) {
+       if (lp_strict_allocate(SNUM(fsp->conn)) && !fsp->fsp_flags.is_sparse) {
                result = strict_allocate_ftruncate(handle, fsp, len);
                END_PROFILE(syscall_ftruncate);
                return result;
@@ -2730,7 +2730,7 @@ static bool vfswrap_lock(vfs_handle_struct *handle, 
files_struct *fsp, int op, o
 
        START_PROFILE(syscall_fcntl_lock);
 
-       if (fsp->use_ofd_locks) {
+       if (fsp->fsp_flags.use_ofd_locks) {
                op = map_process_lock_to_ofd_lock(op);
        }
 
@@ -2800,7 +2800,7 @@ static bool vfswrap_getlock(vfs_handle_struct *handle, 
files_struct *fsp, off_t
 
        START_PROFILE(syscall_fcntl_getlock);
 
-       if (fsp->use_ofd_locks) {
+       if (fsp->fsp_flags.use_ofd_locks) {
                op = map_process_lock_to_ofd_lock(op);
        }
 
@@ -2987,7 +2987,7 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct 
*handle,
        struct stream_struct *tmp_streams = NULL;
        int ret;
 
-       if ((fsp != NULL) && (fsp->is_directory)) {
+       if ((fsp != NULL) && (fsp->fsp_flags.is_directory)) {
                /*
                 * No default streams on directories
                 */
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 1d82b47045c..86870f8f9cf 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -3946,7 +3946,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct 
*handle,
        fsp = *result;
 
        if (global_fruit_config.nego_aapl) {
-               if (config->posix_rename && fsp->is_directory) {
+               if (config->posix_rename && fsp->fsp_flags.is_directory) {
                        /*
                         * Enable POSIX directory rename behaviour
                         */
@@ -3975,8 +3975,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct 
*handle,
                fio->created = true;
        }
 
-       if (is_named_stream(smb_fname)
-           || fsp->is_directory) {
+       if (is_named_stream(smb_fname) || fsp->fsp_flags.is_directory) {
                return status;
        }
 
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 115459bd15d..26b2c52ba98 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -200,7 +200,9 @@ static int vfs_gpfs_close(vfs_handle_struct *handle, 
files_struct *fsp)
                                struct gpfs_config_data,
                                return -1);
 
-       if (config->sharemodes && fsp->kernel_share_modes_taken) {
+       if (config->sharemodes &&
+           (fsp->fsp_flags.kernel_share_modes_taken))
+       {
                /*
                 * Always clear GPFS sharemode in case the actual
                 * close gets deferred due to outstanding POSIX locks
@@ -2071,7 +2073,7 @@ static int vfs_gpfs_fallocate(struct vfs_handle_struct 
*handle,
                              off_t offset, off_t len)
 {
        if (mode == (VFS_FALLOCATE_FL_PUNCH_HOLE|VFS_FALLOCATE_FL_KEEP_SIZE) &&
-           !fsp->is_sparse &&
+           !fsp->fsp_flags.is_sparse &&
            lp_strict_allocate(SNUM(fsp->conn))) {
                /*
                 * This is from a ZERO_DATA request on a non-sparse
diff --git a/source3/modules/vfs_shadow_copy2.c 
b/source3/modules/vfs_shadow_copy2.c
index 3666b2af2b4..c4881c6d53e 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -2767,7 +2767,7 @@ static ssize_t shadow_copy2_pwrite(vfs_handle_struct 
*handle,
 
        nwritten = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
        if (nwritten == -1) {
-               if (errno == EBADF && fsp->can_write) {
+               if (errno == EBADF && fsp->fsp_flags.can_write) {
                        errno = EROFS;
                }
        }
@@ -2840,7 +2840,7 @@ static ssize_t shadow_copy2_pwrite_recv(struct tevent_req 
*req,
 
        if (tevent_req_is_unix_error(req, &vfs_aio_state->error)) {
                if ((vfs_aio_state->error == EBADF) &&
-                   state->fsp->can_write)
+                   state->fsp->fsp_flags.can_write)
                {
                        vfs_aio_state->error = EROFS;
                        errno = EROFS;
diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c
index a863fbc0676..f375c359d6f 100644
--- a/source3/modules/vfs_syncops.c
+++ b/source3/modules/vfs_syncops.c
@@ -280,7 +280,7 @@ static int syncops_close(vfs_handle_struct *handle, 
files_struct *fsp)
                                struct syncops_config_data,
                                return -1);
 
-       if (fsp->can_write && config->onclose) {
+       if (fsp->fsp_flags.can_write && config->onclose) {
                /* ideally we'd only do this if we have written some
                 data, but there is no flag for that in fsp yet. */
                fsync(fsp->fh->fd);
diff --git a/source3/modules/vfs_virusfilter.c 
b/source3/modules/vfs_virusfilter.c
index 12f0364d2a7..256bf420eb1 100644
--- a/source3/modules/vfs_virusfilter.c
+++ b/source3/modules/vfs_virusfilter.c
@@ -1158,7 +1158,7 @@ static int virusfilter_vfs_open(
        SMB_VFS_HANDLE_GET_DATA(handle, config,
                                struct virusfilter_config, return -1);
 
-       if (fsp->is_directory) {
+       if (fsp->fsp_flags.is_directory) {
                DBG_INFO("Not scanned: Directory: %s/\n", cwd_fname);
                goto virusfilter_vfs_open_next;
        }
@@ -1335,7 +1335,7 @@ static int virusfilter_vfs_close(
         * If close failed, file likely doesn't exist, do not try to scan.
         */
        if (close_result == -1 && close_errno == EBADF) {
-               if (fsp->modified) {
+               if (fsp->fsp_flags.modified) {
                        DBG_DEBUG("Removing cache entry (if existent): "
                                  "fname: %s\n", fname);
                        virusfilter_cache_remove(config->cache,
@@ -1344,13 +1344,13 @@ static int virusfilter_vfs_close(
                goto virusfilter_vfs_close_fail;
        }
 
-       if (fsp->is_directory) {
+       if (fsp->fsp_flags.is_directory) {
                DBG_INFO("Not scanned: Directory: %s/\n", cwd_fname);
                return close_result;
        }
 
        if (is_named_stream(fsp->fsp_name)) {
-               if (config->scan_on_open && fsp->modified) {
+               if (config->scan_on_open && fsp->fsp_flags.modified) {
                        if (config->cache) {
                                DBG_DEBUG("Removing cache entry (if existent)"
                                          ": fname: %s\n", fname);
@@ -1365,7 +1365,7 @@ static int virusfilter_vfs_close(
        }
 
        if (!config->scan_on_close) {
-               if (config->scan_on_open && fsp->modified) {
+               if (config->scan_on_open && fsp->fsp_flags.modified) {
                        if (config->cache) {
                                DBG_DEBUG("Removing cache entry (if existent)"
                                          ": fname: %s\n", fname);
@@ -1379,7 +1379,7 @@ static int virusfilter_vfs_close(
                return close_result;
        }
 
-       if (!fsp->modified) {
+       if (!fsp->fsp_flags.modified) {
                DBG_NOTICE("Not scanned: File not modified: %s/%s\n",
                           cwd_fname, fname);
 
diff --git a/source3/printing/printspoolss.c b/source3/printing/printspoolss.c
index 523e429b205..8943452c9d4 100644
--- a/source3/printing/printspoolss.c
+++ b/source3/printing/printspoolss.c
@@ -228,14 +228,14 @@ NTSTATUS print_spool_open(files_struct *fsp,
        fsp->fh->fd = fd;
 
        fsp->vuid = current_vuid;
-       fsp->can_lock = false;
-       fsp->can_read = false;
+       fsp->fsp_flags.can_lock = false;
+       fsp->fsp_flags.can_read = false;
        fsp->access_mask = FILE_GENERIC_WRITE;
-       fsp->can_write = true;
-       fsp->modified = false;
+       fsp->fsp_flags.can_write = true;


-- 
Samba Shared Repository

Reply via email to