Changeset 745 for trunk/server/source4/torture/locktest.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/torture/locktest.c
r414 r745 27 27 #include "libcli/libcli.h" 28 28 #include "param/param.h" 29 #include "dynconfig/dynconfig.h"30 29 #include "libcli/resolve/resolve.h" 31 30 … … 35 34 static int hide_unlock_fails; 36 35 static int use_oplocks; 37 static u int_t lock_range = 100;38 static u int_t lock_base = 0;39 static u int_t min_length = 0;36 static unsigned int lock_range = 100; 37 static unsigned int lock_base = 0; 38 static unsigned int min_length = 0; 40 39 static int exact_error_codes; 41 40 static int zero_zero; … … 120 119 struct smbcli_session_options session_options; 121 120 122 lp _smbcli_options(lp_ctx, &options);123 lp _smbcli_session_options(lp_ctx, &session_options);121 lpcfg_smbcli_options(lp_ctx, &options); 122 lpcfg_smbcli_session_options(lp_ctx, &session_options); 124 123 125 124 printf("connect_one(%s, %d, %d)\n", share, snum, conn); … … 135 134 int num_unc_names; 136 135 const char *p; 137 p = lp _parm_string(lp_ctx, NULL, "torture", "unclist");136 p = lpcfg_parm_string(lp_ctx, NULL, "torture", "unclist"); 138 137 if (p) { 139 138 char *h, *s; … … 156 155 157 156 158 myname = talloc_asprintf(mem_ctx, "lock-% u-%u",getpid(), snum);157 myname = talloc_asprintf(mem_ctx, "lock-%d-%d", (int) getpid(), snum); 159 158 cli_credentials_set_workstation(servers[snum], myname, CRED_SPECIFIED); 160 159 … … 163 162 status = smbcli_full_connection(NULL, &c, 164 163 server, 165 lp _smb_ports(lp_ctx),164 lpcfg_smb_ports(lp_ctx), 166 165 share, NULL, 167 lp _socket_options(lp_ctx),166 lpcfg_socket_options(lp_ctx), 168 167 servers[snum], 169 lp _resolve_context(lp_ctx),168 lpcfg_resolve_context(lp_ctx), 170 169 ev, &options, &session_options, 171 lp_iconv_convenience(lp_ctx), 172 lp_gensec_settings(mem_ctx, lp_ctx)); 170 lpcfg_gensec_settings(mem_ctx, lp_ctx)); 173 171 if (!NT_STATUS_IS_OK(status)) { 174 172 sleep(2); … … 203 201 talloc_free(cli[server][conn]); 204 202 } 205 cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server], 203 cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server], 206 204 server, conn); 207 205 if (!cli[server][conn]) { … … 218 216 struct record *rec) 219 217 { 220 u int_t conn = rec->conn;221 u int_t f = rec->f;218 unsigned int conn = rec->conn; 219 unsigned int f = rec->f; 222 220 uint64_t start = rec->start; 223 221 uint64_t len = rec->len; … … 236 234 237 235 if (!(tree->session->transport->negotiate.capabilities & CAP_LARGE_FILES)) { 238 res=smbcli_lock(tree, fn, start, len, LOCK_TIMEOUT, rec->lock_op);236 res=smbcli_lock(tree, fn, start, len, LOCK_TIMEOUT, (enum brl_type) rec->lock_op); 239 237 } else { 240 238 union smb_lock parms; … … 387 385 { 388 386 int i; 389 printf(" testing %u ...\n", n);387 printf("Testing %u ...\n", n); 390 388 for (i=0; i<n; i++) { 391 389 if (i && i % 100 == 0) { … … 408 406 static int test_locks(struct tevent_context *ev, 409 407 struct loadparm_context *lp_ctx, 410 408 TALLOC_CTX *mem_ctx, 411 409 char *share[NSERVERS]) 412 410 { … … 428 426 recorded[n].conn = random() % NCONNECTIONS; 429 427 recorded[n].f = random() % NFILES; 430 recorded[n].start = lock_base + ((u int_t)random() % (lock_range-1));428 recorded[n].start = lock_base + ((unsigned int)random() % (lock_range-1)); 431 429 recorded[n].len = min_length + 432 430 random() % (lock_range-(recorded[n].start-lock_base)); … … 601 599 switch (opt) { 602 600 case OPT_UNCLIST: 603 lp _set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));601 lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); 604 602 break; 605 603 case 'U':
Note:
See TracChangeset
for help on using the changeset viewer.