static void next_close(struct benchopen_state *state) { if (state->close_fnum == -1) { return; } DEBUG(2,("[%d] closing %d (fnum[%d])\n", state->client_num, state->close_file_num, state->close_fnum)); state->close_parms.close.level = RAW_CLOSE_CLOSE; state->close_parms.close.in.file.fnum = state->close_fnum; state->close_parms.close.in.write_time = 0; state->req_close = smb_raw_close_send(state->tree, &state->close_parms); state->req_close->async.fn = close_completed; state->req_close->async.private_data = state; }
/* close a file */ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_close *io) { struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; struct cvfs_file *f; union smb_close io2; SETUP_PID; if (io->generic.level != RAW_CLOSE_GENERIC && p->map_generic) { return ntvfs_map_close(ntvfs, req, io); } if (io->generic.level == RAW_CLOSE_GENERIC) { ZERO_STRUCT(io2); io2.close.level = RAW_CLOSE_CLOSE; io2.close.in.file = io->generic.in.file; io2.close.in.write_time = io->generic.in.write_time; io = &io2; } SETUP_FILE_HERE(f); /* Note, we aren't free-ing f, or it's h here. Should we? even if file-close fails, we'll remove it from the list, what else would we do? Maybe we should not remove until after the proxied call completes? */ DLIST_REMOVE(p->files, f); if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { return smb_raw_close(p->tree, io); } c_req = smb_raw_close_send(p->tree, io); SIMPLE_ASYNC_TAIL; }
/**************************************************************************** Close a file - sync interface ****************************************************************************/ _PUBLIC_ NTSTATUS smb_raw_close(struct smbcli_tree *tree, union smb_close *parms) { struct smbcli_request *req = smb_raw_close_send(tree, parms); return smbcli_request_simple_recv(req); }