s3/smbd: get rid of files_struct.aapl_copyfile_supported
authorRalph Boehme <slow@samba.org>
Fri, 9 Jun 2017 15:27:17 +0000 (17:27 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 3 Jul 2017 17:59:08 +0000 (19:59 +0200)
A previous commit removed the special hook from the SMB layer, so we
don't need this anymore.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/include/vfs.h
source3/modules/vfs_fruit.c

index 1308cc2da51b159f22457487a5b55805516e4068..b651baef0e23e28d19facadc27fb35872689ac9b 100644 (file)
@@ -335,7 +335,6 @@ typedef struct files_struct {
        bool is_sparse;
        bool backup_intent; /* Handle was successfully opened with backup intent
                                and opener has privilege to do so. */
-       bool aapl_copyfile_supported;
        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. */
index db6324a357467c40d44e53c34cd03c3b97ba6160..36552c1fb94bd3611967bb8a1ebd16ad15957521 100644 (file)
@@ -5124,17 +5124,6 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
        fsp = *result;
 
        if (global_fruit_config.nego_aapl) {
-               if (config->copyfile_enabled) {
-                       /*
-                        * Set a flag in the fsp. Gets used in
-                        * copychunk to check whether the special
-                        * Apple copyfile semantics for copychunk
-                        * should be allowed in a copychunk request
-                        * with a count of 0.
-                        */
-                       fsp->aapl_copyfile_supported = true;
-               }
-
                if (config->posix_rename && fsp->is_directory) {
                        /*
                         * Enable POSIX directory rename behaviour
@@ -5500,6 +5489,7 @@ static struct tevent_req *fruit_offload_write_send(struct vfs_handle_struct *han
        off_t src_off = transfer_offset;
        files_struct *src_fsp = NULL;
        off_t to_copy = num;
+       bool copyfile_enabled = false;
 
        DEBUG(10,("soff: %ju, doff: %ju, len: %ju\n",
                  (uintmax_t)src_off, (uintmax_t)dest_off, (uintmax_t)num));
@@ -5519,12 +5509,7 @@ static struct tevent_req *fruit_offload_write_send(struct vfs_handle_struct *han
        switch (fsctl) {
        case FSCTL_SRV_COPYCHUNK:
        case FSCTL_SRV_COPYCHUNK_WRITE:
-               status = vfs_offload_token_db_fetch_fsp(fruit_offload_ctx,
-                                                       token, &src_fsp);
-               if (tevent_req_nterror(req, status)) {
-                       return tevent_req_post(req, ev);
-               }
-               state->src_fsp = src_fsp;
+               copyfile_enabled = config->copyfile_enabled;
                break;
        default:
                break;
@@ -5536,10 +5521,14 @@ static struct tevent_req *fruit_offload_write_send(struct vfs_handle_struct *han
         * offload_write_send VFS call overloading the parameters src_off
         * = dest_off = num = 0.
         */
-       if ((src_off == 0) && (dest_off == 0) && (num == 0) &&
-           src_fsp != NULL && src_fsp->aapl_copyfile_supported &&
-           dest_fsp->aapl_copyfile_supported)
-       {
+       if (copyfile_enabled && num == 0 && src_off == 0 && dest_off == 0) {
+               status = vfs_offload_token_db_fetch_fsp(
+                       fruit_offload_ctx, token, &src_fsp);
+               if (tevent_req_nterror(req, status)) {
+                       return tevent_req_post(req, ev);
+               }
+               state->src_fsp = src_fsp;
+
                status = vfs_stat_fsp(src_fsp);
                if (tevent_req_nterror(req, status)) {
                        return tevent_req_post(req, ev);