summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-06-09 17:27:17 +0200
committerRalph Boehme <slow@samba.org>2017-07-03 19:59:08 +0200
commitfe6d71d7f978c4db8401ccff3cce17c9368b24e4 (patch)
tree94c0de71fd63c258db7fd01b0f56f3f584a20d71
parent2b3fcc56e6ecc696da753ff3421cb9008fb5f4ea (diff)
downloadsamba-fe6d71d7f978c4db8401ccff3cce17c9368b24e4.tar.gz
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 <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/include/vfs.h1
-rw-r--r--source3/modules/vfs_fruit.c31
2 files changed, 10 insertions, 22 deletions
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);