XXX add lp_enable_copychunk to toggle copychunk support
authorDavid Disseldorp <ddiss@samba.org>
Thu, 3 May 2012 11:52:32 +0000 (13:52 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 15 Apr 2013 16:15:16 +0000 (18:15 +0200)
Usefull for benchmarking.
- DO NOT PUSH

lib/param/param_functions.c
lib/param/param_table.c
source3/include/proto.h
source3/param/loadparm.c
source3/smbd/smb2_ioctl_network_fs.c

index 94652fad896c936797878c6ac72f81e1f241509b..a98a4656485c4323de04d842dbfb84b6f96e666d 100644 (file)
@@ -134,6 +134,7 @@ FN_LOCAL_BOOL(afs_share, bAfs_Share)
 FN_LOCAL_BOOL(acl_check_permissions, bAclCheckPermissions)
 FN_LOCAL_BOOL(acl_group_control, bAclGroupControl)
 FN_LOCAL_BOOL(acl_map_full_control, bAclMapFullControl)
+FN_LOCAL_BOOL(enable_copychunk, bEnableCopychunk)
 FN_LOCAL_INTEGER(defaultcase, iDefaultCase)
 FN_LOCAL_INTEGER(minprintspace, iMinPrintSpace)
 FN_LOCAL_INTEGER(printing, iPrinting)
index a73cd966bc0c13d45993122d722ac1c71e3ecde7..3db42f8225c9e300757ab7a68f17a912070e05cb 100644 (file)
@@ -1729,6 +1729,15 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED,
        },
+       {
+               .label          = "enable copychunk",
+               .type           = P_BOOL,
+               .p_class        = P_LOCAL,
+               .offset         = LOCAL_VAR(bEnableCopychunk),
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
+       },
 
        {N_("Tuning Options"), P_SEP, P_SEPARATOR},
 
index 6856dd7730063cdec3b124f262108f34b621b614..09961babc57b4690f6c5d5024444602122ac82e9 100644 (file)
@@ -1327,6 +1327,7 @@ bool lp_acl_check_permissions(int );
 bool lp_acl_group_control(int );
 bool lp_acl_map_full_control(int );
 bool lp_durable_handles(int);
+bool lp_enable_copychunk(int);
 int lp_create_mask(int );
 int lp_force_create_mode(int );
 int lp_dir_mask(int );
index e09c2bfb7b418252ca8a0a8623e631962c29cf23..acebff448ea9149f85d3e6a691cfbfd77f9eadce 100644 (file)
@@ -266,6 +266,7 @@ static struct loadparm_service sDefault =
        .bAclGroupControl = false,
        .bChangeNotify = true,
        .bKernelChangeNotify = true,
+       .bEnableCopychunk = true,
        .iallocation_roundup_size = SMB_ROUNDUP_ALLOCATION_SIZE,
        .iAioReadSize = 0,
        .iAioWriteSize = 0,
index 1e1e3e5e9429985375a711211f49cbdf8da2f061..a585e6f2c5998a6484dc286de9d7c0730f2e9b98 100644 (file)
@@ -472,9 +472,13 @@ struct tevent_req *smb2_ioctl_network_fs(uint32_t ctl_code,
                return tevent_req_post(req, ev);
                break;
        case FSCTL_SRV_REQUEST_RESUME_KEY:
-               status = fsctl_srv_req_resume_key(state, ev, state->fsp,
-                                                 state->in_max_output,
-                                                 &state->out_output);
+               if (lp_enable_copychunk(state->smbreq->conn->params->service)) {
+                       status = fsctl_srv_req_resume_key(state, ev, state->fsp,
+                                                         state->in_max_output,
+                                                         &state->out_output);
+               } else {
+                       status = NT_STATUS_INVALID_DEVICE_REQUEST;
+               }
                if (!tevent_req_nterror(req, status)) {
                        tevent_req_done(req);
                }