• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/samba-3.5.8/source4/torture/raw/

Lines Matching refs:state

74 static void lock_send(struct benchlock_state *state)
79 switch (state->stage) {
83 state->lock_offset = 0;
84 state->unlock_offset = 0;
85 lock.offset = state->lock_offset;
90 state->lock_offset = (state->lock_offset+1)%(nprocs+1);
91 lock.offset = state->lock_offset;
96 lock.offset = state->unlock_offset;
97 state->unlock_offset = (state->unlock_offset+1)%(nprocs+1);
102 lock.pid = state->tree->session->pid;
108 io.lockx.in.file.fnum = state->fnum;
110 state->req = smb_raw_lock_send(state->tree, &io);
111 if (state->req == NULL) {
115 state->req->async.private_data = state;
116 state->req->async.fn = lock_completion;
126 struct benchlock_state *state = (struct benchlock_state *)private_data;
129 state->fnum = smbcli_open(state->tree, FNAME, O_RDWR|O_CREAT, DENY_NONE);
130 if (state->fnum == -1) {
131 printf("Failed to open %s on connection %d\n", FNAME, state->client_num);
137 DEBUG(0,("reconnect to %s finished (%u connected)\n", state->dest_host,
140 state->stage = LOCK_INITIAL;
141 lock_send(state);
149 struct benchlock_state *state = (struct benchlock_state *)ctx->async.private_data;
151 struct smb_composite_connect *io = &state->reconnect;
153 status = smb_composite_connect_recv(ctx, state->mem_ctx);
155 talloc_free(state->te);
156 state->te = event_add_timed(state->ev, state->mem_ctx,
158 reopen_connection, state);
162 talloc_free(state->tree);
163 state->tree = io->out.tree;
166 event_add_timed(state->ev, state->mem_ctx, timeval_zero(), reopen_file, state);
177 struct benchlock_state *state = (struct benchlock_state *)private_data;
179 struct smb_composite_connect *io = &state->reconnect;
182 state->te = NULL;
184 if (!torture_get_conn_index(state->client_num, state->mem_ctx, state->tctx, &host, &share)) {
189 io->in.dest_host = state->dest_host;
190 io->in.dest_ports = state->dest_ports;
191 io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
192 io->in.socket_options = lp_socket_options(state->tctx->lp_ctx);
193 io->in.called_name = state->called_name;
195 io->in.service_type = state->service_type;
198 io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
199 io->in.iconv_convenience = lp_iconv_convenience(state->tctx->lp_ctx);
200 lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
201 lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
204 talloc_free(state->tree);
205 state->tree = NULL;
207 ctx = smb_composite_connect_send(io, state->mem_ctx,
208 lp_resolve_context(state->tctx->lp_ctx),
209 state->ev);
216 ctx->async.private_data = state;
225 struct benchlock_state *state = (struct benchlock_state *)req->async.private_data;
227 state->req = NULL;
231 talloc_free(state->tree);
232 state->tree = NULL;
234 DEBUG(0,("reopening connection to %s\n", state->dest_host));
235 talloc_free(state->te);
236 state->te = event_add_timed(state->ev, state->mem_ctx,
238 reopen_connection, state);
246 switch (state->stage) {
248 state->stage = LOCK_LOCK;
251 state->stage = LOCK_UNLOCK;
254 state->stage = LOCK_LOCK;
258 state->count++;
259 lock_send(state);
265 struct benchlock_state *state = (struct benchlock_state *)req->async.private_data;
269 talloc_free(state->tree);
270 state->tree = NULL;
272 DEBUG(0,("reopening connection to %s\n", state->dest_host));
273 talloc_free(state->te);
274 state->te = event_add_timed(state->ev, state->mem_ctx,
276 reopen_connection, state);
283 struct benchlock_state *state = talloc_get_type(private_data,
287 printf("%5u ", (unsigned)(state[i].count - state[i].lastcount));
288 state[i].lastcount = state[i].count;
292 event_add_timed(ev, state, timeval_current_ofs(1, 0), report_rate, state);
300 if (!state[i].tree) {
307 req = smb_raw_echo_send(state[i].tree->session->transport, &p);
308 req->async.private_data = &state[i];
323 struct benchlock_state *state;
334 state = talloc_zero_array(mem_ctx, struct benchlock_state, nprocs);
338 state[i].tctx = torture;
339 state[i].mem_ctx = talloc_new(state);
340 state[i].client_num = i;
341 state[i].ev = torture->ev;
345 talloc_steal(mem_ctx, state);
346 state[i].tree = cli->tree;
347 state[i].dest_host = talloc_strdup(state[i].mem_ctx,
349 state[i].dest_ports = talloc_array(state[i].mem_ctx,
351 state[i].dest_ports[0] = talloc_asprintf(state[i].dest_ports,
354 state[i].dest_ports[1] = NULL;
355 state[i].called_name = talloc_strdup(state[i].mem_ctx,
357 state[i].service_type = talloc_strdup(state[i].mem_ctx,
368 state[i].fnum = smbcli_open(state[i].tree,
371 if (state[i].fnum == -1) {
384 if (!NT_STATUS_IS_OK(smbcli_lock64(state[i].tree,
385 state[i].fnum, offset, 1, 0, WRITE_LOCK))) {
391 state[i].stage = LOCK_INITIAL;
392 lock_send(&state[i]);
398 event_add_timed(torture->ev, state, timeval_current_ofs(1, 0), report_rate, state);
412 minops = state[0].count;
414 printf("[%d] %u ops\n", i, state[i].count);
415 if (state[i].count < minops) minops = state[i].count;
423 talloc_free(state[i].req);
424 smb_raw_exit(state[i].tree->session);
427 smbcli_deltree(state[0].tree, BASEDIR);
433 smbcli_deltree(state[0].tree, BASEDIR);