From: Ralph Boehme Date: Fri, 9 Jun 2017 15:27:17 +0000 (+0200) Subject: s3/smbd: get rid of files_struct.aapl_copyfile_supported X-Git-Tag: samba-4.7.0rc1~31 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=fe6d71d7f978c4db8401ccff3cce17c9368b24e4;ds=sidebyside s3/smbd: get rid of files_struct.aapl_copyfile_supported A previous commit removed the special hook from the SMB layer, so we don't need this anymore. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1308cc2da51..b651baef0e2 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -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. */ diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index db6324a3574..36552c1fb94 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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);