]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: move files_struct.initial_delete_on_close to a bitfield
authorRalph Boehme <slow@samba.org>
Fri, 3 Apr 2020 05:43:38 +0000 (07:43 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 3 Apr 2020 19:05:44 +0000 (19:05 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/vfs.h
source3/smbd/close.c
source3/smbd/durable.c
source3/smbd/open.c
source3/smbd/reply.c
source3/smbd/smb2_close.c

index 92f240c61b48a2c3e3f1f930b8f71bb19237f8eb..adb64c61e7033923b2721f2a3bf87495b0ebb907 100644 (file)
@@ -368,6 +368,7 @@ typedef struct files_struct {
                bool modified : 1;
                bool is_directory : 1;
                bool aio_write_behind : 1;
+               bool initial_delete_on_close : 1;
        } fsp_flags;
 
        struct tevent_timer *update_write_time_event;
@@ -388,7 +389,6 @@ typedef struct files_struct {
        struct lock_struct last_lock_failure;
        int current_lock_count; /* Count the number of outstanding locks and pending locks. */
 
-       bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */
        bool delete_on_close;
        uint64_t posix_flags;
        bool is_sparse;
index 05ee03d2484691b9f6c99774dbc3abd8ad95f039..5207a6b67c4db766c68ea497f103ee7899b7bd05 100644 (file)
@@ -338,7 +338,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
                }
        }
 
-       if (fsp->initial_delete_on_close &&
+       if (fsp->fsp_flags.initial_delete_on_close &&
                        !is_delete_on_close_set(lck, fsp->name_hash)) {
                bool became_user = False;
 
@@ -1126,7 +1126,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       if (fsp->initial_delete_on_close) {
+       if (fsp->fsp_flags.initial_delete_on_close) {
                bool became_user = False;
 
                /* Initial delete on close was set - for
index f01df16ec92559c5d252df22b46891bd9dc7901e..f557c51aa69e1b13b898a225409540468ad3b98d 100644 (file)
@@ -180,7 +180,7 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
         * For now let it be simple and do not keep
         * delete on close files durable open
         */
-       if (fsp->initial_delete_on_close) {
+       if (fsp->fsp_flags.initial_delete_on_close) {
                return NT_STATUS_NOT_SUPPORTED;
        }
        if (fsp->delete_on_close) {
index 5fe5c1e58dc737fa9b87d2bc6f173736f720fc36..9eccd6231765292349c3118f491197a54f614bd2 100644 (file)
@@ -3955,7 +3955,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                }
                /* Note that here we set the *initial* delete on close flag,
                   not the regular one. The magic gets handled in close. */
-               fsp->initial_delete_on_close = True;
+               fsp->fsp_flags.initial_delete_on_close = true;
        }
 
        /*
@@ -4536,7 +4536,7 @@ static NTSTATUS open_directory(connection_struct *conn,
                if (NT_STATUS_IS_OK(status)) {
                        /* Note that here we set the *initial* delete on close flag,
                           not the regular one. The magic gets handled in close. */
-                       fsp->initial_delete_on_close = True;
+                       fsp->fsp_flags.initial_delete_on_close = true;
                }
        }
 
index a2d621db1c337c6cbb4b67891e5113167b19f35e..32b3e5dd4ce23e7c919c9dee4aa52c09baa9cd25 100644 (file)
@@ -7871,7 +7871,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                        if (NT_STATUS_IS_OK(status)) {
                                /* Note that here we set the *initial* delete on close flag,
                                 * not the regular one. The magic gets handled in close. */
-                               fsp->initial_delete_on_close = True;
+                               fsp->fsp_flags.initial_delete_on_close = true;
                        }
                }
                TALLOC_FREE(lck);
index 9e3c3daf2e0989a101d61c6a88f3e3540ef261da..d8d0b415af75ca85dc351a3101279ad16c2bc29d 100644 (file)
@@ -240,7 +240,7 @@ static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req,
        }
 
        if ((in_flags & SMB2_CLOSE_FLAGS_FULL_INFORMATION) &&
-           (fsp->initial_delete_on_close ||
+           (fsp->fsp_flags.initial_delete_on_close ||
             fsp->delete_on_close))
        {
                /*