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>
Wed, 19 Sep 2012 03:59:05 +0000 (05:59 +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 ce2f671d73889da6a92f94a0789eb1f639f2182a..47fb036847fdbcb20d9b04d85b262d73466a1c61 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(security_mask, iSecurity_mask)
 FN_LOCAL_INTEGER(force_security_mode, iSecurity_force_mode)
 FN_LOCAL_INTEGER(dir_security_mask, iDir_Security_mask)
index 325f2953423dcef9fe16e3e69ce38aa7f30e3b01..18d8919a168bc9df0cb5ca44bbccd4b1e9c14843 100644 (file)
@@ -1784,6 +1784,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 b3fa55a9143ffb2578fbdb4f450c565dcc490c81..a617292532253a7f4bebd8fae54527e3995d3fc3 100644 (file)
@@ -1328,6 +1328,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_security_mask(int );
index 61606ce9d20577b00df9c9a061c6a75020660f59..cf80161e7410bcb3d4b7f4ac81fccad3ef480474 100644 (file)
@@ -270,6 +270,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 ca01a0aa9e979608705c254ac6f49adc1cf00ea7..de43a26be9f168bf4b6ebb5d6d61221600e847d2 100644 (file)
@@ -369,9 +369,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);
                }